Is there any AutoScale kind of option without Layers?

Discuss any general programming issues here
Post Reply
Bugala
Posts: 1178
Joined: Sun Feb 14, 2010 7:11 pm

Is there any AutoScale kind of option without Layers?

Post 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?
amyren
Posts: 352
Joined: Thu May 02, 2019 11:53 am

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

Post 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.
Bugala
Posts: 1178
Joined: Sun Feb 14, 2010 7:11 pm

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

Post by Bugala »

hmm..
thanks. Thought that wouldnt work unless layers are on, but now that i tried, it does actually work. Good.
amyren
Posts: 352
Joined: Thu May 02, 2019 11:53 am

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

Post 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.
User avatar
Clyde
Posts: 348
Joined: Sun Feb 14, 2010 12:38 pm
Location: Dresden / Germany

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

Post 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.

..."
Currently using: Hollywood 9 with Windows IDE and Hollywood 9 with Visual Studio Code and hw4vsc
amyren
Posts: 352
Joined: Thu May 02, 2019 11:53 am

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

Post 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.
Bugala
Posts: 1178
Joined: Sun Feb 14, 2010 7:11 pm

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

Post 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.
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

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

Post by airsoftsoftwair »

There are two scaling engines in Hollywood:

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