Class ScreenSpace.Screen
- Direct Known Subclasses:
ScreenSpace.UIScreen
- Enclosing class:
ScreenSpace
ScreenSpace
. The screen lifecycle is:
init [wake gainedFocus lostFocus sleep]+ dispose
.
When the screen has the potential to become visible (due to the user scrolling part of
the screen into view) it will have been wakened. If the user selects the screen, it will be
animated into position and then gainedFocus
will be called. If the user scrolls a
new screen into view, lostFocus
will be called, the screen will be animated away. If
the screen is no longer "at risk" of being shown, sleep
will be called. When the
screen is finally removed from the screen space, dispose
will be called.
-
Field Summary
Modifier and TypeFieldDescriptionfinal GroupLayer
Contains the scene graph root for this screen.final react.Signal<Clock>
A signal emitted on every frame, while this screen is showing.final react.Signal<Clock>
A signal emitted on every simulation update, while this screen is showing. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
awake()
Returns true when this screen is awake.boolean
Returns whether or not an untransition gesture may be initiated viadir
.void
Addsac
to a list of closeables which will be closed when this screen goes to sleep.void
dispose()
Called when this screen is removed from the screen space.void
Called when this screen has become the active screen.void
init()
Called when this screen is first added to the screen space.void
Called when some other screen is about to become the active screen.pythagoras.f.IDimension
size()
Returns the size of this screen, for use by transitions.react.ValueView<pythagoras.f.IDimension>
The size of this screen as a reactive value.void
sleep()
Called when this screen is no longer at risk of being seen by the user.toString()
boolean
Returns true when this screen is in-transition.void
wake()
Called when this screen will potentially be shown.
-
Field Details
-
layer
Contains the scene graph root for this screen. -
update
A signal emitted on every simulation update, while this screen is showing. -
paint
A signal emitted on every frame, while this screen is showing.
-
-
Constructor Details
-
Screen
-
-
Method Details
-
init
public void init()Called when this screen is first added to the screen space. -
size
public pythagoras.f.IDimension size()Returns the size of this screen, for use by transitions. Defaults to the size of the entire view. -
sizeValue
public react.ValueView<pythagoras.f.IDimension> sizeValue()The size of this screen as a reactive value. Listeners are notified when the screen size changes. -
awake
public boolean awake()Returns true when this screen is awake. -
transiting
public boolean transiting()Returns true when this screen is in-transition. -
wake
public void wake()Called when this screen will potentially be shown. Should create main UI and prepare it for display. -
gainedFocus
public void gainedFocus()Called when this screen has become the active screen. -
lostFocus
public void lostFocus()Called when some other screen is about to become the active screen. This screen will be animated out of view. This may not be immediately followed by a call tosleep()
because the screen may remain visible due to incidental scrolling by the user. Only when the screen is separated from the focus screen by at least one screen will it be put to sleep. -
sleep
public void sleep()Called when this screen is no longer at risk of being seen by the user. This should dispose the UI and minimize the screen's memory footprint as much as possible. -
dispose
public void dispose()Called when this screen is removed from the screen space. This will always be preceded by a call tosleep()
, but if there are any resources that the screen retains until it is completely released, this is the place to remove them. -
canUntrans
Returns whether or not an untransition gesture may be initiated viadir
.By default this requires that the screen be at its origin in x or y depending on the orientation of
dir
. If a screen uses aFlicker
to scroll vertically, this will automatically do the right thing. If there are other circumstances in which a screen wishes to prevent the user from initiating an untransition gesture, this is the place to put 'em. -
closeOnSleep
Addsac
to a list of closeables which will be closed when this screen goes to sleep. -
toString
-