## Libraries.Game.Graphics.DrawableShape Documentation

*Inherits from: *Libraries.Language.Object

## Summary

### Variable Summary Table

Variables | Description |
---|---|

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 poin |

integer Y_OFFSET | The vertex index of the first y-coordinate valu |

integer X_OFFSET | The vertex index of the first x-coordinate valu |

integer VERTEX_SIZE | How many number components are stored for each verte |

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 poin |

integer Z_OFFSET | The vertex index of the first z-coordinate valu |

integer COLOR_OFFSET | The vertex index of the first color valu |

### Actions Summary Table

Actions | Description |
---|---|

Compare(Libraries.Language.Object object) | This action compares two object hash codes and returns an integer. |

Equals(Libraries.Language.Object object) | This action determines if two objects are equal based on their hash code values. |

FlipX() | This is a value between 0 and 1, indicating where this point is between the top and the bottom of the shap |

FlipY() | "Flip" the value across 0, then make it positive again. |

GetBoundingRectangle() | Vertices are set to negative Z to reverse draw orde |

GetDataCount() | This action returns how many total number values are stored across all of the shape's vertices. |

GetDrawable() | |

GetHashCode() | This action gets the hash code for an object. |

GetHeight() | The vertex index of the first "u" coordinate. |

GetIndexCount() | This action returns how many indices are used to render this shape as triangles. |

GetMesh() | This action returns how many total number values are stored across all of the shape's vertices. |

GetVertexCount() | This action returns how many vertices are used to form this shape. |

GetVertexData(integer index) | This action returns how many indices are used to render this shape as triangles. |

GetWidth() | The vertex index of the first "v" coordinate. |

IsRenderable() | This action returns how many vertices are used to form this shape. |

Load(Libraries.Containers.Array<number> points) | This action generates a Drawable shape from the set of given points. |

Load(Libraries.Containers.Array<number> points, Libraries.Game.Graphics.TextureRegion region) | This action generates a Drawable shape from the set of given points. |

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. |

LoadRectangle(number width, number height, Libraries.Game.Graphics.TextureRegion region) | Cached bounding rectangle. |

LoadRectangle(number width, number height) | A specialized mesh used to render this shape. |

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. |

LoadTriangle(number x1, number y1, number x2, number y2, number x3, number y3) | How many number components are stored for each verte |

NeedsUpdate() | The vertex index of the first y-coordinate valu |

RequestUpdate() | The vertex index of the first z-coordinate valu |

SetColor(Libraries.Game.Graphics.Color color) | "Flip" the value across 0, then make it positive again. |

SetColor(Libraries.Containers.Array<Libraries.Game.Graphics.Color> colors) | This is a value between 0 and 1, indicating how far to the left or right this point is within the shap |

SetColor(number colorCode) | This is a value between 0 and 1, indicating where this point is between the top and the bottom of the shap |

SetColor(Libraries.Game.Graphics.ColorGroup group) | Figure out the minimum/maximum x valu |

SetDrawable(Libraries.Game.Graphics.Drawable drawable) | |

SetHeight(number height) | This is a value between 0 and 1, indicating how far to the left or right this point is within the shap |

SetSize(number width, number height) | Figure out the minimum/maximum x and y values so we can associate left/bottom with minimum x/y, and right/top with maximum x |

SetTextureRegion(Libraries.Game.Graphics.TextureRegion region) | This action generates a Drawable shape from the set of given points. |

SetTextureRegion(number left, number right, number bottom, number top) | This action generates a Drawable shape from the set of given points. |

SetWidth(number width) | Figure out the minimum/maximum x valu |

UpdateVertices() |

## 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.

**Example Code**

```
Object o
Object t
integer result = o:Compare(t) //1 (larger), 0 (equal), or -1 (smaller)
```

#### Parameters

- Libraries.Language.Object: The object to compare to.

#### Return

integer: The Compare result, Smaller, Equal, or Larger.

### Equals(Libraries.Language.Object object)

This action determines if two objects are equal based on their hash code values.

**Example Code**

```
use Libraries.Language.Object
use Libraries.Language.Types.Text
Object o
Text t
boolean result = o:Equals(t)
```

#### Parameters

- Libraries.Language.Object: The to be compared.

#### Return

boolean: True if the hash codes are equal and false if they are not equal.

### FlipX()

This is a value between 0 and 1, indicating where this point is between the top and the bottom of the shap

### FlipY()

"Flip" the value across 0, then make it positive again. 0 becomes 1, 1 becomes 0, and all other values fall in betwe

### GetBoundingRectangle()

Vertices are set to negative Z to reverse draw orde

#### Return

Libraries.Game.Shapes.Rectangle:

### GetDataCount()

This action returns how many total number values are stored across all of the shape's vertices.

#### Return

integer:

### GetDrawable()

#### Return

Libraries.Game.Graphics.Drawable

### GetHashCode()

This action gets the hash code for an object.

**Example Code**

```
Object o
integer hash = o:GetHashCode()
```

#### Return

integer: The integer hash code of the object.

### GetHeight()

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 poin

#### Return

number:

### GetIndexCount()

This action returns how many indices are used to render this shape as triangles.

#### Return

integer:

### GetMesh()

This action returns how many total number values are stored across all of the shape's vertices.

#### Return

### GetVertexCount()

This action returns how many vertices are used to form this shape.

#### Return

integer:

### GetVertexData(integer index)

This action returns how many indices are used to render this shape as triangles.

#### Parameters

#### Return

number:

### GetWidth()

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 poin

#### Return

number:

### IsRenderable()

This action returns how many vertices are used to form this shape.

#### Return

boolean:

### 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

### 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

### 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

### LoadRectangle(number width, number height, Libraries.Game.Graphics.TextureRegion region)

Cached bounding rectangle. Undefined if no rectangle has been requeste

#### Parameters

### 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 instea

#### Parameters

### 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

### LoadTriangle(number x1, number y1, number x2, number y2, number x3, number y3)

How many number components are stored for each verte

#### Parameters

### NeedsUpdate()

The vertex index of the first y-coordinate valu

#### Return

boolean:

### RequestUpdate()

The vertex index of the first z-coordinate valu

### 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 betwe

#### Parameters

### SetColor(Libraries.Containers.Array<Libraries.Game.Graphics.Color> colors)

This is a value between 0 and 1, indicating how far to the left or right this point is within the shap

#### Parameters

### SetColor(number colorCode)

#### Parameters

### SetColor(Libraries.Game.Graphics.ColorGroup group)

Figure out the minimum/maximum x valu

#### Parameters

### SetDrawable(Libraries.Game.Graphics.Drawable drawable)

#### Parameters

### SetHeight(number height)

#### Parameters

### SetSize(number width, number height)

Figure out the minimum/maximum x and y values so we can associate left/bottom with minimum x/y, and right/top with maximum x

#### Parameters

### 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

### SetTextureRegion(number left, number right, number bottom, number top)

#### Parameters

### SetWidth(number width)

Figure out the minimum/maximum x valu