Layer (class)
Revision as of 01:43, 12 January 2018 by Yingchun Soul (talk | contribs)
This class provides fields/functions for managing Layers in the current level. Accessing Layers only work after the code file is initiated and after onStart!
| Layer class | |||
|---|---|---|---|
| Type | Function/Field | Return values/Value type | Description |
| Constructor | myLayer = Layer(int internalIndex) | Layer | Construct a new Layer-Object. Only use this constructor with caution. Use Layer.get() or Layer.find() instead! |
| function | Layer:stop() | nil | Stops layer's movements. |
| function | Layer:show(boolean noSmoke) | nil | Shows the layer. If noSmoke is true, then no smoke will be displayed on showing. (LunaLua ≥v0.7) |
| function | Layer:hide(boolean noSmoke) | nil | Hides the layer. If noSmoke is true, then no smoke will be displayed on hiding. (LunaLua ≥v0.7) |
| function | Layer:toggle(boolean noSmoke) | nil | Toggles (Showing/Hiding) the layer. If noSmoke is true, then no smoke will be displayed on showing/hiding. (LunaLua ≥v0.7) |
| Field (ro) | Layer.isHidden | boolean | Returns true, if the layer is hidden. (LunaLua ≥v0.7) |
| Field (ro) | Layer.layerName | VBStr | The layer name. |
| Field | Layer.speedX | double | The x-speed of the layer. |
| Field | Layer.speedY | double | The y-speed of the layer. |