GUIs larger than viewport: unnecessary restrictions

Started by Monsieur OUXX, Fri 04/09/2015 08:37:36

Previous topic - Next topic

Monsieur OUXX

[low priority]

Consider the following :
(Note: I didn't test if the behaviour below is the same when you change the gui's dimensions directly in the properties panel to make the gui directly larger than the viewport)
1) Create a 640x400 game
2) Create a 640x400 GUI
3) In the game general settings, change to 320x200, and when prompted, tell the Editor that you DON'T WANT the guis to be resized
=> You have a 640x400 GUI in a 320x200 game. So far, everything behaves as it was programmed to.


Now:
- Run the game. At startup the Editor gives you a warning about the inconsistent dimensions. But I have observed that the games runs correctly, even when using the gui's drawing surface.

However:
- Try to change the dimension of the gui. If you want to set it back to a normal size, you write :
Code: ags

gMyGui.Width=320;
gMyGui.Height=200;

- Problem: The program stops at the first instruction. Why? Because that would mean the gui is now temporarily 320x400. And the engine has a built-in safety mechanism to prevent that at runtime, even though the dimensions were already "incorrect" at startup.

My point is : if it turns out AGS has no issues dealing with guis larger than the screen, then it could be a good idea to remove that check.
PS: I'm writing a vectorial tool that can be run at any resolution, the higher resolution only makes the graphics more accurate. That's why I want to resize guis at startup, to make sure they match the actual resolution.
 


SMF spam blocked by CleanTalk