Module flower.DisplayObject

The base class of the display object, adding several useful methods.

Extends:

Info:

  • Release: V3.0.0
  • Author: Makoto

Functions

DisplayObject:init () The constructor.
DisplayObject:getSize () Returns the size.
DisplayObject:getWidth () Returns the width.
DisplayObject:getHeight () Returns the height.
DisplayObject:setPos (left, top) Sets the position.
DisplayObject:getPos () Returns the position.
DisplayObject:getLeft () Returns the left position.
DisplayObject:setLeft (value) Set the left position.
DisplayObject:getTop () Returns the top position.
DisplayObject:setTop (value) Set the top position.
DisplayObject:getRight () Returns the right position.
DisplayObject:setRight (value) Set the right position.
DisplayObject:getBottom () Returns the bottom position.
DisplayObject:setBottom (value) Set the bottom position.
DisplayObject:getColor () Returns the color.
DisplayObject:setPivToCenter () Sets the piv (the anchor around which the object can 'pivot') to the object's center.
DisplayObject:getVisible () Returns whether or not the object is currently visible or invisible.
DisplayObject:setVisible (visible) Sets the visibility.
DisplayObject:setParent (parent) Sets the object's parent, inheriting its color and transform.
DisplayObject:setLayer (layer) Insert the DisplayObject's prop into a given Moai layer.
DisplayObject:setScissorRect (scissorRect) Set the scissor rect.


Functions

DisplayObject:init ()
The constructor.
DisplayObject:getSize ()
Returns the size. If there is a function that returns a negative getDims. getSize function always returns the size of the positive.

Returns:

    width, height, depth
DisplayObject:getWidth ()
Returns the width.

Returns:

    width
DisplayObject:getHeight ()
Returns the height.

Returns:

    height
DisplayObject:setPos (left, top)
Sets the position. Without depending on the Pivot, move the top left corner as the origin.

Parameters:

  • left Left position
  • top Top position
DisplayObject:getPos ()
Returns the position.

Returns:

  1. Left
  2. Top
DisplayObject:getLeft ()
Returns the left position.

Returns:

    left
DisplayObject:setLeft (value)
Set the left position.

Parameters:

  • value left position.
DisplayObject:getTop ()
Returns the top position.

Returns:

    top
DisplayObject:setTop (value)
Set the top position.

Parameters:

  • value top position.
DisplayObject:getRight ()
Returns the right position.

Returns:

    right
DisplayObject:setRight (value)
Set the right position.

Parameters:

  • value right position.
DisplayObject:getBottom ()
Returns the bottom position.

Returns:

    bottom
DisplayObject:setBottom (value)
Set the bottom position.

Parameters:

  • value bottom position.
DisplayObject:getColor ()
Returns the color.

Returns:

    red, green, blue, alpha
DisplayObject:setPivToCenter ()
Sets the piv (the anchor around which the object can 'pivot') to the object's center.
DisplayObject:getVisible ()
Returns whether or not the object is currently visible or invisible.

Returns:

    visible
DisplayObject:setVisible (visible)
Sets the visibility. TODO:I avoid the bug of display settings MOAIProp.(2013/05/20 last build)

Parameters:

  • visible visible
DisplayObject:setParent (parent)
Sets the object's parent, inheriting its color and transform.

Parameters:

  • parent parent
DisplayObject:setLayer (layer)
Insert the DisplayObject's prop into a given Moai layer.

Parameters:

  • layer
DisplayObject:setScissorRect (scissorRect)
Set the scissor rect.

Parameters:

  • scissorRect scissorRect
generated by LDoc 1.3