|
A container that scrolls its child control up over time. More...
Public Member Functions | |
void | reset () |
Reset scrolling. | |
Callbacks | |
void | onComplete () |
Called when the child control has been scrolled in entirety. | |
void | onReset () |
Called when the child control is reset to its initial position and the cycle starts again. | |
void | onStart () |
Called when the control starts to scroll. | |
void | onTick () |
Called every 32ms on the control. | |
Public Attributes | |
Scrolling | |
int | childBorder |
Padding to put around child control (in pixels). | |
bool | isLooping |
If true, the scrolling will reset to the beginning once completing a cycle. | |
float | resetDelay |
Seconds to wait after scrolling completes before resetting and starting over. | |
GuiAutoScrollDirection | scrollDirection |
Direction in which the child control is moved. | |
bool | scrollOutOfSight |
If true, the child control will be completely scrolled out of sight; otherwise it will only scroll until the other end becomes visible. | |
float | scrollSpeed |
Scrolling speed in pixels per second. | |
float | startDelay |
Seconds to wait before starting to scroll. |
A container that scrolls its child control up over time.
This container can be used to scroll a single child control in either of the four directions.
// Create a GuiAutoScrollCtrl that scrolls a long text of credits. new GuiAutoScrollCtrl( CreditsScroller ) { position = "0 0"; extent = Canvas.extent.x SPC Canvas.extent.y; scrollDirection = "Up"; // Scroll upwards. startDelay = 4; // Wait 4 seconds before starting to scroll. isLooping = false; // Don't loop the credits. scrollOutOfSight = true; // Scroll up fully. new GuiMLTextCtrl() { text = $CREDITS; }; }; function CreditsScroller::onComplete( %this ) { // Switch back to main menu after credits have rolled. Canvas.setContent( MainMenu ); } // Start rolling credits. Canvas.setContent( CreditsScroller );
void GuiAutoScrollCtrl::onComplete | ( | ) |
Called when the child control has been scrolled in entirety.
void GuiAutoScrollCtrl::onReset | ( | ) |
Called when the child control is reset to its initial position and the cycle starts again.
void GuiAutoScrollCtrl::onStart | ( | ) |
Called when the control starts to scroll.
void GuiAutoScrollCtrl::onTick | ( | ) |
Called every 32ms on the control.
void GuiAutoScrollCtrl::reset | ( | ) |
Reset scrolling.
Padding to put around child control (in pixels).
If true, the scrolling will reset to the beginning once completing a cycle.
Seconds to wait after scrolling completes before resetting and starting over.
Direction in which the child control is moved.
If true, the child control will be completely scrolled out of sight; otherwise it will only scroll until the other end becomes visible.
Scrolling speed in pixels per second.
Seconds to wait before starting to scroll.