Class: Toybox.WatchUi.Layer

Inherits:
Toybox.Lang.Object show all

Overview

A representation of View Layer that will be drawn (bitblit) by system onto the screen during screen update, which include regular View update (onUpdate/onPartialUpdate) as well as animation playback if supported.

Since:

API Level 3.1.0

Direct Known Subclasses

WatchUi.AnimationLayer

Typedef Summary collapse

Instance Method Summary collapse

Typedef Details

Options as { :locX as Lang.Numeric, :locY as Lang.Numeric, :width as Lang.Number, :height as Lang.Number, :colorDepth as Lang.Number, :visibility as Lang.Boolean, :identifier as Lang.Object }

Since:

API Level 3.1.0

Instance Method Details

getDc() as Graphics.Dc or Null

Get the Graphics.Dc to draw on.

Since:

API Level 3.1.0

getId() as Lang.Object or Null

Layer identifier, can be null

Returns:

Since:

API Level 3.1.0

getX() as Lang.Numeric

Get X-axis absolute draw offset relative to the screen origin

Returns:

  • Lang.Number

    X-axis absolute draw offset relative to the screen origin

Since:

API Level 3.1.0

getY() as Lang.Numeric

Get Y-axis absolute draw offset relative to the screen origin

Returns:

  • Lang.Number

    Y-axis absolute draw offset relative to the screen origin

Since:

API Level 3.1.0

initialize(options as Layer.Options or Null)

Constructor

Parameters:

  • options(Lang.Dictionary)

    A Dictionary of options; can be null, which defaults to full screen layer

    • :locX(Lang.Number)

      The x coordinate of the top left corner of the layer (optional defaults to 0)

    • :locY(Lang.Number)

      The y coordinate of the top left corner of the layer (optional defaults to 0)

    • :width(Lang.Number)

      The width of the layers in pixels,

    • :height(Lang.Number)

      The height of the layers in pixels,

    • :colorDepth(Lang.Number)

      hidden option, Color depth in terms of bits/pixel, when missing, default to system value.

    • :visibility(Lang.Boolean)

      true if the layer is visible, otherwise false (optional, default to +true+)

    • :identifier(Lang.Object)

      unique object for identification (optional)

Since:

API Level 3.1.0

isVisible() as Lang.Boolean

Returns:

  • Lang.Boolean

    true if the layer is visible otherwise false

Since:

API Level 3.1.0

setLocation(x as Lang.Numeric, y as Lang.Numeric) as Void

Set draw offset relative to the screen origin

Parameters:

  • x(Lang.Number)

    new x offset from screen origin

  • y(Lang.Number)

    new y offset from screen origin

Since:

API Level 3.1.0

setVisible(visible as Lang.Boolean) as Void

Set visibility of the layer, if the layer hasn't been added to a view, or the view isn't on top of view stack, the value will be saved.

Parameters:

  • visible(Lang.Boolean)

    true for visible (or to show), false for invisible (or to hide).

Since:

API Level 3.1.0

setX(x as Lang.Numeric) as Void

Set X-axis absolute draw offset relative to the screen origin

Parameters:

  • x(Lang.Number)

    new x offset from screen origin

Since:

API Level 3.1.0

setY(y as Lang.Numeric) as Void

Set Y-axis absolute draw offset relative to the screen origin

Parameters:

  • y(Lang.Number)

    new y offset from screen origin

Since:

API Level 3.1.0


Generated Dec 11, 2024, 8:58:44 AM