Libraries.Game.Graphics.DrawableShape Documentation
Inherits from: Libraries.Language.Object
Variables Table
Variables | Description |
---|---|
integer COLOR_OFFSET | The vertex index of the first color value. |
integer V_OFFSET | The vertex index of the first "v" coordinate. When applying a texture to the shape, this is the y-coordinate on the texture where sampling will occur for this point. |
integer Z_OFFSET | The vertex index of the first z-coordinate value. |
integer MINIMUM_VERTEX_SIZE | The minimum legal size a vertex can be and still be usable for a standard Drawable. |
integer X_OFFSET | The vertex index of the first x-coordinate value. |
integer Y_OFFSET | The vertex index of the first y-coordinate value. |
integer U_OFFSET | The vertex index of the first "u" coordinate. When applying a texture to the shape, this is the x-coordinate on the texture where sampling will occur for this point. |
Actions Documentation
Compare(Libraries.Language.Object object)
This action compares two object hash codes and returns an integer. The result is larger if this hash code is larger than the object passed as a parameter, smaller, or equal. In this case, -1 means smaller, 0 means equal, and 1 means larger. This action was changed in Quorum 7 to return an integer, instead of a CompareResult object, because the previous implementation was causing efficiency issues.
Parameters
- Libraries.Language.Object: The object to compare to.
Return
integer: The Compare result, Smaller, Equal, or Larger.
Example
Object o
Object t
integer result = o:Compare(t) //1 (larger), 0 (equal), or -1 (smaller)
Equals(Libraries.Language.Object object)
This action determines if two objects are equal based on their hash code values.
Parameters
- Libraries.Language.Object: The to be compared.
Return
boolean: True if the hash codes are equal and false if they are not equal.
Example
use Libraries.Language.Object
use Libraries.Language.Types.Text
Object o
Text t
boolean result = o:Equals(t)
FlipX()
This is a value between 0 and 1, indicating where this point is between the top and the bottom of the shape.
FlipY()
"Flip" the value across 0, then make it positive again. 0 becomes 1, 1 becomes 0, and all other values fall in between
GetBoundingRectangle()
GetClippingX1()
Return
number
GetClippingX2()
Return
number
GetClippingY1()
Return
number
GetClippingY2()
Return
number
GetDataCount()
This action returns how many total number values are stored across all of the shape's vertices.
Return
integer:
GetDrawable()
GetHashCode()
This action gets the hash code for an object.
Return
integer: The integer hash code of the object.
Example
Object o
integer hash = o:GetHashCode()
GetHeight()
This is a value between 0 and 1, indicating how far to the left or right this point is within the shape.
Return
number:
GetIndexCount()
This action returns how many indices are used to render this shape as triangles.
Return
integer:
GetMesh()
GetVertexCount()
This action returns how many vertices are used to form this shape.
Return
integer:
GetVertexData()
This action returns how many vertices are used to form this shape.
Return
GetVertexData(integer index)
This action returns how many total number values are stored across all of the shape's vertices.
Parameters
- integer index
Return
number:
GetVertexSize()
Return
integer
GetWidth()
Figure out the minimum/maximum x values
Return
number:
HasClipping()
Copy any values that are still legitimate to the new array.
Return
boolean:
IsRenderable()
Return
boolean
Load(Libraries.Containers.Array<number> points, Libraries.Game.Graphics.TextureRegion region)
This action generates a Drawable shape from the set of given points. These points must be in clockwise order.
Parameters
Load(Libraries.Containers.Array<number> points)
This action generates a Drawable shape from the set of given points. These points must be in clockwise order.
Parameters
LoadRectangle(number width, number height, number textureLeft, number textureRight, number textureBottom, number textureTop)
The width and height of this shape, as calculated from the base positions. May not reflect the exact width and height of the values in the vertices if the Drawable has been scaled or rotated.
Parameters
- number width
- number height
- number textureLeft
- number textureRight
- number textureBottom
- number textureTop
LoadRectangle(number width, number height)
A specialized mesh used to render this shape. If this shape is just a rectangle, this is left undefined, and the Painter2D uses its default mesh instead.
Parameters
- number width
- number height
LoadRectangle(number width, number height, Libraries.Game.Graphics.TextureRegion region)
Cached bounding rectangle. Undefined if no rectangle has been requested.
Parameters
- number width
- number height
- Libraries.Game.Graphics.TextureRegion
LoadTriangle(number x1, number y1, number x2, number y2, number x3, number y3)
How many number components are stored for each vertex.
Parameters
- number x1
- number y1
- number x2
- number y2
- number x3
- number y3
LoadTriangle(number x1, number y1, number x2, number y2, number x3, number y3, Libraries.Game.Graphics.TextureRegion region)
The position of each point relative to the origin of the Drawable. This is a sequence of x, y coordinates. Z-coordinates are not stored here. This is undefined if the shape hasn't been loaded yet.
Parameters
- number x1
- number y1
- number x2
- number y2
- number x3
- number y3
- Libraries.Game.Graphics.TextureRegion
NeedsUpdate()
The vertex index of the first "v" coordinate. When applying a texture to the shape, this is the y-coordinate on the texture where sampling will occur for this point.
Return
boolean:
RequestUpdate()
The minimum legal size a vertex can be and still be usable for a standard Drawable.
SetColor(Libraries.Game.Graphics.Color color)
"Flip" the value across 0, then make it positive again. 0 becomes 1, 1 becomes 0, and all other values fall in between
Parameters
SetColor(Libraries.Containers.Array<Libraries.Game.Graphics.Color> colors)
We'll only update the mesh if at least one of the values actually changed.
Parameters
SetColor(number colorCode)
This is a value between 0 and 1, indicating where this point is between the top and the bottom of the shape.
Parameters
- number colorCode
SetColor(Libraries.Game.Graphics.ColorGroup group)
We'll only update the mesh if at least one of the values actually changed.
Parameters
SetDataForAllVertices(integer offset, number value)
The vertex index of the first y-coordinate value.
Parameters
- integer offset
- number value
SetDrawable(Libraries.Game.Graphics.Drawable drawable)
SetHeight(number height)
Figure out the minimum/maximum x values
Parameters
- number height
SetSize(number width, number height)
This is a value between 0 and 1, indicating how far to the left or right this point is within the shape.
Parameters
- number width
- number height
SetTextureRegion(number left, number right, number bottom, number top)
This action generates a Drawable shape from the set of given points. These points must be in clockwise order.
Parameters
- number left
- number right
- number bottom
- number top
SetTextureRegion(Libraries.Game.Graphics.TextureRegion region)
This action generates a Drawable shape from the set of given points. These points must be in clockwise order.
Parameters
SetVertexData(integer index, number value)
This action returns how many indices are used to render this shape as triangles.
Parameters
- integer index
- number value
SetVertexSize(integer newSize)
Parameters
- integer newSize
SetWidth(number width)
We'll only update the mesh if at least one of the values actually changed.
Parameters
- number width
UpdateVertices()
The vertex index of the first "u" coordinate. When applying a texture to the shape, this is the x-coordinate on the texture where sampling will occur for this point.
On this page
Variables TableAction Documentation- Compare(Libraries.Language.Object object)
- Equals(Libraries.Language.Object object)
- FlipX()
- FlipY()
- GetBoundingRectangle()
- GetClippingX1()
- GetClippingX2()
- GetClippingY1()
- GetClippingY2()
- GetDataCount()
- GetDrawable()
- GetHashCode()
- GetHeight()
- GetIndexCount()
- GetMesh()
- GetVertexCount()
- GetVertexData()
- GetVertexData(integer index)
- GetVertexSize()
- GetWidth()
- HasClipping()
- IsRenderable()
- Load(Libraries.Containers.Array
points, Libraries.Game.Graphics.TextureRegion region) - Load(Libraries.Containers.Array
points) - LoadRectangle(number width, number height, number textureLeft, number textureRight, number textureBottom, number textureTop)
- LoadRectangle(number width, number height)
- LoadRectangle(number width, number height, Libraries.Game.Graphics.TextureRegion region)
- LoadTriangle(number x1, number y1, number x2, number y2, number x3, number y3)
- LoadTriangle(number x1, number y1, number x2, number y2, number x3, number y3, Libraries.Game.Graphics.TextureRegion region)
- NeedsUpdate()
- RequestUpdate()
- SetColor(Libraries.Game.Graphics.Color color)
- SetColor(Libraries.Containers.Array
colors) - SetColor(number colorCode)
- SetColor(Libraries.Game.Graphics.ColorGroup group)
- SetDataForAllVertices(integer offset, number value)
- SetDrawable(Libraries.Game.Graphics.Drawable drawable)
- SetHeight(number height)
- SetSize(number width, number height)
- SetTextureRegion(number left, number right, number bottom, number top)
- SetTextureRegion(Libraries.Game.Graphics.TextureRegion region)
- SetVertexData(integer index, number value)
- SetVertexSize(integer newSize)
- SetWidth(number width)
- UpdateVertices()