class BitmapLayer

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 BitmapLayer : Layer

Constructors

BitmapLayer ()Creates a new layer with default properties.
BitmapLayer (int, int, Bitmap)Constructs a new bitmap layer using the specified coords and bitmap.

Methods

Bitmap (Bitmap)Sets a new bitmap to draw.
Bitmap Bitmap ()Returns the layer's current bitmap.
int Fading ()Returns the layer's current fade delta.
Fading (int)Sets the layer's current fade delta.
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.
Offset (int, int)Specifies a drawing offset.
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.
Show ()Shows the layer if it was hidden.
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 BitmapLayer ()

Creates a new layer with default properties.

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


method BitmapLayer (int x, int y, Bitmap b)

Constructs a new bitmap layer using the specified coords and bitmap.

The layer will automatically be adapted to the bitmap's size. However, you can change the layer's size afterwards, if you want to draw only a portion of the image.


method Bitmap (Bitmap)

Sets a new bitmap to draw.


method Bitmap Bitmap ()

Returns the layer's current bitmap.


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 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 Offset (int dx, int dy)

Specifies a drawing offset.

This sets a point in the bitmap from where drawing should begin. This makes sense if the layer's area is smaller than the actual bitmap and only a portion of the image should be drawn (e.g. an icon in a bitmap with many icons).


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 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 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.