Mixin Positional
Positional mixin.
Apply to classes that have a x, y position in the world.
Usage:
local MyClass = class("MyClass")
MyClass:include( Positional )
Class Positional
| Positional:setPos (x, y) | Set the object's position. |
| Positional:getPos () | Gets the object's position. |
| Positional:move (x, y) | Move this object relative to its current position. |
Class Positional
- Positional:setPos (x, y)
-
Set the object's position.
Parameters:
- x number x-coordinate.
- y number y-coordinate.
Returns:
-
Positional
self
- Positional:getPos ()
-
Gets the object's position.
Returns:
- number x
- number y
- Positional:move (x, y)
-
Move this object relative to its current position.
Parameters:
- x number relative x
- y number relative y
Returns:
-
Positional
self