Page 1 of 1

Is there any AutoScale kind of option without Layers?

Posted: Sat Jul 27, 2019 9:44 am
by Bugala
As I made my latest game mainly without using Layers, and as games resolution of 1920x1080 brings problem to Amigalike OSes, is there a way to do something similar like when using Layers I can just choose Autoscale=on?

Re: Is there any AutoScale kind of option without Layers?

Posted: Wed Jul 31, 2019 9:55 pm
by amyren
Are you thinking of something like this?

Code: Select all

@DISPLAY {Title = "MY Program", ScaleMode = #SCALEMODE_AUTO, FitScale = True}
You could also add MODE="fakefullscreen" or MODE="fullscreen" if you want to fill the screen. Or just use sizeable=true so that the window can be scaled by the user.

Re: Is there any AutoScale kind of option without Layers?

Posted: Thu Aug 01, 2019 2:13 pm
by Bugala
hmm..
thanks. Thought that wouldnt work unless layers are on, but now that i tried, it does actually work. Good.

Re: Is there any AutoScale kind of option without Layers?

Posted: Thu Aug 01, 2019 9:22 pm
by amyren
just out of couriosity, you mention that the game is made mostly without layers.
If I understand you correctly you have parts of the program using layers, and other parts not?

I figures this was interesting, so I did a test on my own game that uses layers. The about window doesnt need layers anyway, so I did a test there.
I did it by using disablelayers just after the DisplayBGPic, and then I was able to load a sprite and display it on the about window.
Then removing the sprite before enabling layers again. Another test was to do the same thing in my main window, by using freelayers before disabling layers, then displaying the sprite and removing it again. Both tests worked well.
Do you change from layers to non-layers and back in the same manner?

Notice that you can also change scalemode at the same time, from scalemode_layer to scalemode_auto and back using the setdisplayattributes.
I am note sure this is recommended though, but it does work.

Re: Is there any AutoScale kind of option without Layers?

Posted: Thu Aug 01, 2019 11:02 pm
by Clyde
@amyren: At least what you can find in the docu you shouldn't do that. See "Layers Library -> Overview":

"...

What you should try to avoid is disabling layers in a display in which they have been enabled before. This is possible to do but it should be avoided in any case because layered and non-layered modes are distinctly different.

..."

Re: Is there any AutoScale kind of option without Layers?

Posted: Fri Aug 02, 2019 11:40 am
by amyren
Clyde wrote: Thu Aug 01, 2019 11:02 pm @amyren: At least what you can find in the docu you shouldn't do that. See "Layers Library -> Overview":

"...

What you should try to avoid is disabling layers in a display in which they have been enabled before. This is possible to do but it should be avoided in any case because layered and non-layered modes are distinctly different.

..."
Yes, I remember reading that somewhere, thats why I made that comment in the last line of my post.

For the first test I did mention i my post, setdisplayattributes was used to change mode for that other display, and then change mode back to layer when closing that display. For this purpose, I think it should be ok, since it is a different display.

That other test was just to verify that it could work, but (as you pointed out) was indeed against the recommendation since it was done on a layered display.

Re: Is there any AutoScale kind of option without Layers?

Posted: Fri Aug 02, 2019 6:33 pm
by Bugala
well, in my case game uses non layers approach. However, as competition time was nearing end and I wanted the game to end with a text that would scroll from bottom to up and back, and another text to fade in and out, it was easiest to simply use enablelayers, then createtextobjext and display and remove them with the hollywoods FX options.
After that program quits.

In addition, as I used pre-existing code for the main menu system, that part of game is using layers too, so after starting the game, it tells to disablelayers and from that point on, until that very end part, it is not using layers at all as far as i can recall.

Re: Is there any AutoScale kind of option without Layers?

Posted: Thu Aug 08, 2019 7:37 pm
by airsoftsoftwair
There are two scaling engines in Hollywood:

1) Autoscaling works with and without layers
2) Layerscaling only works with layers