Main   Class List   Namespace List   Wiki

GuiAutoScrollCtrl Class Reference
[Container Controls]

A container that scrolls its child control up over time. More...

Inheritance diagram for GuiAutoScrollCtrl:
Inheritance graph
[legend]

List of all members.

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.

Detailed Description

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.

Example:
// 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 );
Note:
Only the first child will be scrolled.

Member Function Documentation

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.


Member Data Documentation

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.

Note:
Only takes effect if isLooping is true.

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.



Copyright © GarageGames, LLC. All Rights Reserved.