So, I'm just now realizing this, but it may be an important thing to keep in mind when creating layouts.. but since the screensaver is a layout, and your layout is re-loaded when returning to it, it can have some adverse effects:
local text = fe.add_text("Move me", 0, 0, 300, 30);
fe.add_transition_callback("transition_callback" );
function transition_callback(ttype, var, ttime)
{
if (ttype == Transition.ToNewSelection)
{
text.y = 100;
}
}
With code like this, that means if the transition had already occurred before the screensaver, the object will get put back to the original position when returning from the screensaver.
First, is screensaver the only thing that might cause your layout to be reloaded, or are there other scenarios (apart from loading a different layout)?
Second, what's the best way to "save state" here? Wherever my objects are when the screensaver occurs, that's where i want them to be when it comes back.
Should we be storing values of object properties when we alter them, in order to restore when re-loading the layout?
I'm having one of "those" coding days, so maybe I'm just completely doing something stupid.