Try the layout I did quite a long time ago. https://github.com/Luke-Nukem/attract-extra/tree/master/layouts/swapper
Exactly!
I've come to realize tables in squirrel are awesome. If you bundle all the variables settings into tables - it could hold vertical/horizontal/different aspects/different resolutions settings easily and give you a nice and neat one-stop place to go for altering them.
Not only is it much better then hunting down something in code but it forces you to keep different aspects/rotations in mind when you are designing it
You can also throw all this into a separate shared .nut and use it across layout.nut, layout-vert.nut, layout-*.nut like I did with objects here:
https://github.com/liquid8d/attract-extra/blob/master/layouts/sample_animate/resources/shared.nut
We could open up a thread in scripting to discuss more
That might be an idea. I'm going to re-work that old layout soon.
Can we get the actual screen resolution from AM? If not, perhaps there should be a way to start AM with a set operating system native res, and grab that in script.
Hang on:
width - Get/set the layout width. Default value is ScreenWidth.
height - Get/set the layout height. Default value is ScreenHeight.
This tells me that both of these are set to the start-up screen res. (if no layout is loaded)
As a test, I tried this. Works fine.
orig_width <- fe.layout.width;
orig_height <- fe.layout.height;
print("Rotation = "+actual_rotation);
if (( actual_rotation == RotateScreen.Left ) || ( actual_rotation == RotateScreen.Right ))
{
fe.layout.height = fe.layout.width;
fe.layout.width = fe.layout.height;
title_Y = (fe.layout.height / 1.08);
wheel_Y = (fe.layout.height / 1.20);
wheelXDiviser = 2.8;
}
else
{
fe.layout.height = fe.layout.height;
fe.layout.width = fe.layout.width;
title_Y = (fe.layout.height / 1.10);
wheel_Y = (fe.layout.height / 1.33);
wheelXDiviser = 2.4;
}
On reload, it grabs the actual screen res and stores it as a global var that doesn't get touched. Now we can change the screen width and height for a rotation, by just swapping them around.
The globals retain the original res incase we want to switch back to the original orientation.
I just spent 6 months studying Python at University, I'm finding that Squirrel is quite similar in a lot of ways which is great, I can easily transfer my knowledge to it.