Scenery (class)
This class provides fields/functions for managing scenery objects on the overworld.
Static functions
Static Scenery Functions | ||
---|---|---|
Function | Return values | Description |
Scenery.count() | number | How many scenery objects are on the overworld. |
Scenery.get() | table of Scenery | Returns all scenery objects on the overworld. |
Scenery.get(number or table ids) | table of Scenery | Returns all scenery objects with the matching item ids. |
Scenery.getIntersecting(number x1, number y1, number x2, number y2) | table of Scenery | Returns all scenery objects which are intersecting with an area from x1/y1 to x2/y2. |
Instance functions
These fields and functions are part of Scenery Objects and have to be called for that object. Trying to call them from the static Scenery class will result in an error. Example (feel free to copy it into your lua file to see how it works):
function onStart()
for index,myScene in ipairs(Scenery.get()) do
myScene.id = 1
end
end
Scenery class | |||
---|---|---|---|
Type | Function/Field | Return values/Value type | Description |
Field | Scenery.id | double | The id of the scenery object. |
Field | Scenery.x | double | The x position of the scenery object. |
Field | Scenery.y | double | The y position of the scenery object. |
Field | Scenery.width | double | The width of the scenery object. |
Field | Scenery.height | double | The height of the scenery object. |
Field | Scenery.isValid | boolean | Whether the object is valid or not. |