class TextLayer

A layer is a rectangular graphical object that can be placed on the Screen.

Depending on it's type, it can be drawn as text, an image, or as a filled rectangle. The layer's properties can be manipulated anytime, for example to move the layer across the screen, change it's size, look, or z-order. The three available Layer implementations are BitmapLayer, RectLayer and TextLayer.

Inheritance

class TextLayer : Layer

Constructors

TextLayer ()Creates a new layer with default properties.
TextLayer (int, int, int, string)

Methods

int Align ()
Align (int)
AutoSize ()
int Fading ()Returns the layer's current fade delta.
Fading (int)Sets the layer's current fade delta.
int Font ()
Font (int)
Color GetColor ()
int GroupID ()Returns the layer's group ID.
GroupID (int)Sets the layer's group ID.
int Height ()Returns the layer's current height.
Hide ()Hides the layer if it was visible.
int Index ()Returns the layer's index.
int IsVisible ()Returns true if the layer is currently visible (not hidden).
MoveBy (int, int)Moves the layer by the specified offsets.
MoveTo (int, int)Moves the layer to the specified coordinates.
int Opacity ()Sets the layer's global opacity.
Opacity (int)Sets the layer's global opacity.
ResizeBy (int, int)Resizes the layer by the specified offsets.
ResizeTo (int, int)Resizes the layer to the specified width and height.
SetColor (Color)
int Shadow ()
Shadow (int)
Show ()Shows the layer if it was hidden.
string Text ()
Text (string)
var User ()Returns the layer's user value.
User (var)Sets the layer's user value.
int Width ()Returns the layer's current width.
int X ()Returns the layer's current x-coord.
int Y ()Returns the layer's current y-coord.

Reference

method TextLayer ()

Creates a new layer with default properties.

Only layers added to the Screen by calling Screen::AddLayer() will be drawn.


method TextLayer (int x, int y, int font, string text)


method int Align ()


method Align (int)


method AutoSize ()


method int Fading ()

Returns the layer's current fade delta.

If the layer is currently not fading in or out, this returns 0.


method Fading (int delta)

Sets the layer's current fade delta.

A negative delta sets the fade out speed, a positive delta sets the fade in speed. Once the layer is fully faded out or in, the fade delta will be reset to 0.


method int Font ()


method Font (int)


method Color GetColor ()


method int GroupID ()

Returns the layer's group ID.

By default this returns 0.


method GroupID (int id)

Sets the layer's group ID.

The group ID can be any user chosen value. The system does not use this property.


method int Height ()

Returns the layer's current height.


method Hide ()

Hides the layer if it was visible.

This will not take effect on the screen immediately. The layer will be cleared the next time the Screen is drawn.


method int Index ()

Returns the layer's index.

The index is a unique integer value assigned to each layer by the system.


method int IsVisible ()

Returns true if the layer is currently visible (not hidden).

Hidden layers will not be drawn and not also not taken into account by Screen::LayerCollision().


method MoveBy (int dx, int dy)

Moves the layer by the specified offsets.


method MoveTo (int x, int y)

Moves the layer to the specified coordinates.

The coordinates do not need to be inside the screen's visible area.


method int Opacity ()

Sets the layer's global opacity.

If the layer is currently fading, this value will reflect the layer's change in opacity.


method Opacity (int amount)

Sets the layer's global opacity.

A value of 65535 will make the layer fully opaque, 0 will make the layer fully invisible. Setting this value will not cancel any fading that may be in progress.


method ResizeBy (int dw, int dh)

Resizes the layer by the specified offsets.


method ResizeTo (int w, int h)

Resizes the layer to the specified width and height.

There is no limit to the width and height of the layer, though values less than or equal to zero will result in the layer not being drawn.


method SetColor (Color)


method int Shadow ()


method Shadow (int)


method Show ()

Shows the layer if it was hidden.

This will not draw the layer immediately. The layer will be visible the next time the Screen is drawn.


method string Text ()


method Text (string)


method var User ()

Returns the layer's user value.

By default this returns null.


method User (var item)

Sets the layer's user value.

This can be a reference to any object. The system does not use this property.


method int Width ()

Returns the layer's current width.


method int X ()

Returns the layer's current x-coord.


method int Y ()

Returns the layer's current y-coord.