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:

  1. number x
  2. 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
generated by LDoc 1.4.3 Last updated 2015-04-20 03:01:38