Murl Engine Lua Addon API  Version 1.0 beta
Murl.Graph.IPlaneSequenceGeometry

The IPlaneSequenceGeometry graph node interface.

This interface represents a flat rectangular geometry object (quad) in world space that retrieves its actual size and texture coordinates from a given Resource::IAtlas object.

Use the Graph::IIndexed base interface to access the individual rectangles stored in the referenced resource atlas.
Use the Graph::IScalable base interface to set an overall scaling factor for the geometry.

See Graph::IPlaneGeometry for a non-animated version.


Table members

Inherited


Murl.Graph.IDrawable
Murl.Graph.IIndexed
Murl.Graph.IScalable

Methods


GetNodeInterface()

Get the constant Graph::INode interface. This method returns a constant pointer to the node's Graph::INode interface, to be able to query common node properties such as active state, visibility or ID.

Murl.Graph.INode GetNodeInterface()

Returns
Murl.Graph.INode The constant Graph::INode interface, or null if not available

GetTransformInterface()

Get the constant Graph::ITransform interface. This method returns a constant pointer to the node's Graph::ITransform interface, to be able to query the node's transformation matrix and depth order.

Murl.Graph.ITransform GetTransformInterface()

Returns
Murl.Graph.ITransform The constant Graph::ITransform interface, or null if not available

GetAtlasResourceTarget()

Get a constant Graph::IAtlasResourceTarget container. This method returns a constant pointer to a Graph::IAtlasResourceTarget container, which allows to query the atlas resources referenced by a node implementing this interface.

Murl.Graph.IGenericResourceTarget.ResourceIAtlas GetAtlasResourceTarget()

Returns
Murl.Graph.IGenericResourceTarget.ResourceIAtlas The constant Graph::IAtlasResourceTarget container, or null if not available

AddAttribute(item)

Add an attribute item to the plane's vertex data prior to initialization. This method allows to add one of the available attribute items to the plane's internal vertex buffer. Available items from the IEnums::AttributeItem enum are NORMAL, BINORMAL, TANGENT, COLOR, TEXCOORD_0 and TEXCOORD_1. The item COORD is always present, and by default also TEXCOORD_0 is active. See also RemoveAttribute() to unset the latter one.

Boolean AddAttribute(Murl.IEnums.AttributeItem item)

Parameters
itemThe item to add.
Returns
Boolean true if successful.

RemoveAttribute(item)

Remove an attribute item frome the plane's vertex data prior to initialization. See AddAttribute().

Boolean RemoveAttribute(Murl.IEnums.AttributeItem item)

Parameters
itemThe item to remove.
Returns
Boolean true if successful.

SetTextureSize(sizeX, sizeY, index)

Set the texture reference size. Generally, texture coordinates are represented by values ranging from 0.0 to 1.0. As a convenience, this method can be used to set an arbitrary reference size for both dimensions of the plane; this way it is possible to specify integer (pixel) values instead of (quite unreadable) floats. For example, if a 256x128 texture is to be used when rendering this plane, a sizeX value of 256 and sizeY value of 128 directly maps incoming integer texture coordinates to whole texture pixels. Note, that it may also be necessary to set these values depending on the actual texture coordinates stored in the Resource::IAtlas that is referenced; it is often desired to store an atlas' texture coordinates with an already present scale factor. Use the index parameter to specify the actual set of texture coordinates for which to set the reference size, either 0 for TEXCOORD_0 or 1 for TEXCOORD_1.

Boolean SetTextureSize(Number sizeX, Number sizeY, Integer index)

Parameters
sizeXThe horizontal (X, or U) texture coordinate reference size.
sizeYThe vertical (Y, or V) texture coordinate reference size.
indexThe index of the texture coordinate set.
Returns
Boolean true if successful.

SetTextureSizeX(sizeX, index)

Set the horizontal texture reference size. See SetTextureSize().

Boolean SetTextureSizeX(Number sizeX, Integer index)

Parameters
sizeXThe horizontal (X, or U) texture coordinate reference size.
indexThe index of the texture coordinate set.
Returns
Boolean true if successful.

SetTextureSizeY(sizeY, index)

Set the vertical texture reference size. See SetTextureSize().

Boolean SetTextureSizeY(Number sizeY, Integer index)

Parameters
sizeYThe vertical (Y, or V) texture coordinate reference size.
indexThe index of the texture coordinate set.
Returns
Boolean true if successful.

GetTextureSizeX(index)

Get the horizontal texture reference size. See SetTextureSize().

Number GetTextureSizeX(Integer index)

Parameters
indexThe index of the texture coordinate set.
Returns
Number The horizontal (X, or U) texture coordinate reference size.

GetTextureSizeY(index)

Get the vertical texture reference size. See SetTextureSize().

Number GetTextureSizeY(Integer index)

Parameters
indexThe index of the texture coordinate set.
Returns
Number The vertical (Y, or V) texture coordinate reference size.

SetTexCoord(x1, y1, x2, y2, index)

Set the plane's texture coordinates. This method sets the plane's start and end texture coordinates, to allow for rendering only part of the currently active texture on the plane. All given texture coordinate values are divided by their respective reference sizes (See SetTextureSize() for description), before they are actually applied for rendering. An IPlaneSequenceGeometry directly takes the texture coordinates for set #0 from the given atlas resource, so this method only accepts the value 1 for the index parameter to set texture coordinates for set #1 (TEXCOORD_1).

Boolean SetTexCoord(Number x1, Number y1, Number x2, Number y2, Integer index)

Parameters
x1The start coordinate in X direction.
y1The start coordinate in Y direction.
x2The end coordinate in X direction.
y2The end coordinate in Y direction.
indexThe index of the texture coordinate set.
Returns
Boolean true if successful.

SetTexCoord1(x1, y1, index)

Set the plane's start texture coordinates. See SetTexCoord().

Boolean SetTexCoord1(Number x1, Number y1, Integer index)

Parameters
x1The start coordinate in X direction.
y1The start coordinate in Y direction.
indexThe index of the texture coordinate set.
Returns
Boolean true if successful.

SetTexCoord2(x2, y2, index)

Set the plane's end texture coordinates. See SetTexCoord().

Boolean SetTexCoord2(Number x2, Number y2, Integer index)

Parameters
x2The end coordinate in X direction.
y2The end coordinate in Y direction.
indexThe index of the texture coordinate set.
Returns
Boolean true if successful.

SetTexCoordX1(x1, index)

Set the plane's horizontal start texture coordinate. See SetTexCoord().

Boolean SetTexCoordX1(Number x1, Integer index)

Parameters
x1The start coordinate in X direction.
indexThe index of the texture coordinate set.
Returns
Boolean true if successful.

SetTexCoordY1(y1, index)

Set the plane's vertical start texture coordinates. See SetTexCoord().

Boolean SetTexCoordY1(Number y1, Integer index)

Parameters
y1The start coordinate in Y direction.
indexThe index of the texture coordinate set.
Returns
Boolean true if successful.

SetTexCoordX2(x2, index)

Set the plane's horizontal end texture coordinate. See SetTexCoord().

Boolean SetTexCoordX2(Number x2, Integer index)

Parameters
x2The end coordinate in X direction.
indexThe index of the texture coordinate set.
Returns
Boolean true if successful.

SetTexCoordY2(y2, index)

Set the plane's vertical end texture coordinates. See SetTexCoord().

Boolean SetTexCoordY2(Number y2, Integer index)

Parameters
y2The end coordinate in Y direction.
indexThe index of the texture coordinate set.
Returns
Boolean true if successful.

GetTexCoordX1(index)

Get the plane's horizontal start texture coordinate. See SetTexCoord().

Number GetTexCoordX1(Integer index)

Parameters
indexThe index of the texture coordinate set.
Returns
Number The start coordinate in X direction.

GetTexCoordY1(index)

Get the plane's vertical start texture coordinate. See SetTexCoord().

Number GetTexCoordY1(Integer index)

Parameters
indexThe index of the texture coordinate set.
Returns
Number The start coordinate in Y direction.

GetTexCoordX2(index)

Get the plane's horizontal end texture coordinate. See SetTexCoord().

Number GetTexCoordX2(Integer index)

Parameters
indexThe index of the texture coordinate set.
Returns
Number The end coordinate in X direction.

GetTexCoordY2(index)

Get the plane's vertical end texture coordinate. See SetTexCoord().

Number GetTexCoordY2(Integer index)

Parameters
indexThe index of the texture coordinate set.
Returns
Number The end coordinate in Y direction.

GetFrameSizeX()

Get the width of the currently displayed atlas rectangle.

Number GetFrameSizeX()

Returns
Number The current atlas rectangle width.

GetFrameSizeX(frameIndex)

Get the width of a given atlas rectangle.

Number GetFrameSizeX(Integer frameIndex)

Parameters
frameIndexThe zero-based index into the referenced atlas resource's rectangles.
Returns
Number The atlas rectangle width, or 0 if the given index is out of range.

GetFrameSizeY()

Get the height of the currently displayed atlas rectangle.

Number GetFrameSizeY()

Returns
Number The current atlas rectangle height.

GetFrameSizeY(frameIndex)

Get the height of a given atlas rectangle.

Number GetFrameSizeY(Integer frameIndex)

Parameters
frameIndexThe zero-based index into the referenced atlas resource's rectangles.
Returns
Number The atlas rectangle height, or 0 if the given index is out of range.

SetContainerAlignment(alignmentX, alignmentY)

Set the horizontal container alignment. The given alignment values specify how the text container is actually positioned with respect to the node's world position.

Boolean SetContainerAlignment(Murl.IEnums.AlignmentX alignmentX, Murl.IEnums.AlignmentY alignmentY)

Parameters
alignmentXThe horizontal container alignment.
alignmentYThe vertical container alignment.
Returns
Boolean true if successful.

SetContainerAlignmentX(alignmentX)

Set the horizontal container alignment. See SetContainerAlignment().

Boolean SetContainerAlignmentX(Murl.IEnums.AlignmentX alignmentX)

Parameters
alignmentXThe horizontal container alignment.
Returns
Boolean true if successful.

SetContainerAlignmentY(alignmentY)

Set the vertical container alignment. See SetContainerAlignment().

Boolean SetContainerAlignmentY(Murl.IEnums.AlignmentY alignmentY)

Parameters
alignmentYThe vertical container alignment.
Returns
Boolean true if successful.

GetContainerAlignmentX()

Get the horizontal container alignment.

Murl.IEnums.AlignmentX GetContainerAlignmentX()

Returns
Murl.IEnums.AlignmentX The horizontal container alignment.

GetContainerAlignmentY()

Get the vertical container alignment.

Murl.IEnums.AlignmentY GetContainerAlignmentY()

Returns
Murl.IEnums.AlignmentY The vertical container alignment.

SetBorder(borderX, borderY)

Set the horizontal and vertical borders used for alignment.

Boolean SetBorder(Number borderX, Number borderY)

Parameters
borderXThe horizontal border.
borderYThe vertical border.
Returns
Boolean true if successful.

SetBorderX(borderX)

Set the horizontal border used for alignment.

Boolean SetBorderX(Number borderX)

Parameters
borderXThe horizontal border.
Returns
Boolean true if successful.

SetBorderY(borderY)

Set the vertical border used for alignment.

Boolean SetBorderY(Number borderY)

Parameters
borderYThe vertical border.
Returns
Boolean true if successful.

GetBorderX()

Get the horizontal border used for alignment.

Number GetBorderX()

Returns
Number The horizontal border.

GetBorderY()

Get the vertical border used for alignment.

Number GetBorderY()

Returns
Number The vertical border.

SetRectangleName(rectangleName)

Set the current atlas rectangle by name. If the given name is empty, the rectangle is explicitly set via a given index (see SetIndex()). This method fails if no atlas resource is set, or the given name is not found within the atlas resource.

Boolean SetRectangleName(String rectangleName)

Parameters
rectangleNameThe rectangle name.
Returns
Boolean true if successful.

GetRectangleName()

Get the current rectangle's name. This method returns an empty string when no atlas resource is defined or the currently active rectangle is unnamed.

String GetRectangleName()

Returns
String The rectangle name if available.