Moai SDK  1.5 revision 1 (MoaiEdition)
MOAIProp2D Class Reference
Inheritance diagram for MOAIProp2D:
MOAITransform2D MOAIColor MOAIRenderable MOAITransformBase MOAINode MOAINode MOAIInstanceEventSource MOAIInstanceEventSource MOAIEventSource MOAIEventSource MOAILayer2D

List of all members.

Function List

  getGrid
  getIndex
  getPriority
  inside
  setBlendMode
  setCullMode
  setDeck
  setDepthMask
  setDepthTest
  setExpandForSort
  setFrame
  setGrid
  setGridScale
  setIndex
  setParent
  setPriority
  setRemapper
  setShader
  setTexture
  setUVTransform
  setVisible

Function Documentation

Get the grid currently connected to the prop.


function getGrid ( MOAIProp2D self )
Parameters:
self ( MOAIProp2D )
Returns:
grid ( MOAIGrid )

Gets the value of the deck indexer.


function getIndex ( MOAIProp2D self )
Parameters:
self ( MOAIProp2D )
Returns:
index ( number )

Returns the current priority of the node or 'nil' if the priority is uninitialized.


function getPriority ( MOAIProp2D self )
Parameters:
self ( MOAIProp2D )
Returns:
priority ( number )

Returns true if the given world space point falls inside the prop's bounds.


function inside ( MOAIProp2D self, number x, number y, number z [, number pad ] )
Parameters:
self ( MOAIProp2D )
x ( number )
y ( number )
z ( number )
pad ( number ) Optional. Pad the hit bounds (in the prop's local space)
Returns:
isInside ( boolean )

Set the blend mode.


function setBlendMode ( MOAIProp2D self )
Parameters:
self ( MOAIProp2D )
Returns:
nil
Note:
Reset the blend mode to MOAIProp2D.BLEND_NORMAL (equivalent to src = GL_ONE, dst = GL_ONE_MINUS_SRC_ALPHA)

function setBlendMode ( MOAIProp2D self, number mode )
Parameters:
self ( MOAIProp2D )
mode ( number ) One of MOAIProp2D.BLEND_NORMAL, MOAIProp2D.BLEND_ADD, MOAIProp2D.BLEND_MULTIPLY.
Returns:
nil
Note:
Set blend mode using one of the Moai presets.

function setBlendMode ( MOAIProp2D self, number srcFactor, number dstFactor )
Parameters:
self ( MOAIProp2D )
srcFactor ( number )
dstFactor ( number )
Returns:
nil
Note:
Set blend mode using OpenGL source and dest factors. OpenGl blend factor constants are exposed as members of MOAIProp2D. See the OpenGL documentation for an explanation of blending constants.

Sets and enables face culling.


function setCullMode ( MOAIProp2D self [, number cullMode ] )
Parameters:
self ( MOAIProp2D )
cullMode ( number ) Optional. Default value is MOAIProp2D.CULL_NONE.
Returns:
nil

Sets or clears the deck to be indexed by the prop.


function setDeck ( MOAIProp2D self [, MOAIDeck deck ] )
Parameters:
self ( MOAIProp2D )
deck ( MOAIDeck ) Optional. Default value is nil.
Returns:
nil

Disables or enables depth writing.


function setDepthMask ( MOAIProp2D self [, boolean depthMask ] )
Parameters:
self ( MOAIProp2D )
depthMask ( boolean ) Optional. Default value is true.
Returns:
nil

Sets and enables depth testing (assuming depth buffer is present).


function setDepthTest ( MOAIProp2D self [, number depthFunc ] )
Parameters:
self ( MOAIProp2D )
depthFunc ( number ) Optional. Default value is MOAIProp2D.DEPTH_TEST_DISABLE.
Returns:
nil

Used when drawing with a layout scheme (i.e. MOAIGrid). Expanding for sort causes the prop to emit a sub-prim for each component of the layout. For example, when attaching a MOAIGrid to a prop, each cell of the grid will be added to the render queue for sorting against all other props and sub-prims. This is obviously less efficient, but still more efficient then using an separate prop for each cell or object.


function setExpandForSort ( MOAIProp2D self, boolean expandForSort )
Parameters:
self ( MOAIProp2D )
expandForSort ( boolean ) Default value is false.
Returns:
nil

Sets the fitting frame of the prop.


function setFrame ( MOAIProp2D self )
Parameters:
self ( MOAIProp2D )
Returns:
nil
Note:
Clear the fitting frame.

function setFrame ( MOAIProp2D self, number xMin, number yMin, number xMax, number yMax )
Parameters:
self ( MOAIProp2D )
xMin ( number )
yMin ( number )
xMax ( number )
yMax ( number )
Returns:
nil
Note:
Set the fitting frame.

Sets or clears the prop's grid indexer. The grid indexer (if any) will override the standard indexer.


function setGrid ( MOAIProp2D self [, MOAIGrid grid ] )
Parameters:
self ( MOAIProp2D )
grid ( MOAIGrid ) Optional. Default value is nil.
Returns:
nil

Scale applied to deck items before rendering to grid cell.


function setGridScale ( MOAIProp2D self [, number xScale, number yScale ] )
Parameters:
self ( MOAIProp2D )
xScale ( number ) Optional. Default value is 1.
yScale ( number ) Optional. Default value is 1.
Returns:
nil

Set the prop's index into its deck.


function setIndex ( MOAIProp2D self [, number index ] )
Parameters:
self ( MOAIProp2D )
index ( number ) Optional. Default value is 1.
Returns:
nil

This method has been deprecated. Use MOAINode setAttrLink instead.


function setParent ( MOAIProp2D self [, MOAINode parent ] )
Parameters:
self ( MOAIProp2D )
parent ( MOAINode ) Optional. Default value is nil.
Returns:
nil

Reimplemented from MOAIColor.

Sets or clears the node's priority. Clear the priority to have MOAIPartition automatically assign a priority to a node when it is added.


function setPriority ( MOAIProp2D self [, number priority ] )
Parameters:
self ( MOAIProp2D )
priority ( number ) Optional. Default value is nil.
Returns:
nil

Set a remapper for this prop to use when drawing deck members.


function setRemapper ( MOAIProp2D self [, MOAIDeckRemapper remapper ] )
Parameters:
self ( MOAIProp2D )
remapper ( MOAIDeckRemapper ) Optional. Default value is nil.
Returns:
nil

Sets or clears the prop's shader. The prop's shader takes precedence over any shader specified by the deck or its elements.


function setShader ( MOAIProp2D self [, MOAIShader shader ] )
Parameters:
self ( MOAIProp2D )
shader ( MOAIShader ) Optional. Default value is nil.
Returns:
nil

Set or load a texture for this prop. The prop's texture will override the deck's texture.


function setTexture ( MOAIProp2D self, variant texture [, number transform ] )
Parameters:
self ( MOAIProp2D )
texture ( variant ) A MOAITexture, MOAIMultiTexture, MOAIDataBuffer or a path to a texture file
transform ( number ) Optional. Any bitwise combination of MOAITextureBase.QUANTIZE, MOAITextureBase.TRUECOLOR, MOAITextureBase.PREMULTIPLY_ALPHA
Returns:
texture ( MOAIGfxState )

Sets or clears the prop's UV transform.


function setUVTransform ( MOAIProp2D self [, MOAITransformBase transform ] )
Parameters:
self ( MOAIProp2D )
transform ( MOAITransformBase ) Optional. Default value is nil.
Returns:
nil

Sets or clears the prop's visibility.


function setVisible ( MOAIProp2D self [, boolean visible ] )
Parameters:
self ( MOAIProp2D )
visible ( boolean ) Optional. Default value is true.
Returns:
nil