Latite Scripting Documentation (Exports)
Exports > gfx/graphics > Graphics
Interface
Source: gfx/graphics.d.ts:112
drawItem( item:
ItemStack, pos:Vector2, sizeModifier:number, opacity:number):void
Draw an item instance.
Source: gfx/graphics.d.ts:163
| Parameter | Type | Description |
|---|---|---|
| item | ItemStack |
The item to draw |
| pos | Vector2 |
The position in pixels to draw the texture |
| sizeModifier | number |
The relative size modifier (defualt: 1.0, aka 16 pixels) |
| opacity | number |
The opacity of the item |
void
drawRect( rect:
Rect, color:Color, thickness:number, radius?:number):void
Source: gfx/graphics.d.ts:118
| Parameter | Type |
|---|---|
| rect | Rect |
| color | Color |
| thickness | number |
| radius? | number |
void
drawText( pos:
Vector2, text:string, size:number, color:Color):void
Draws text on the position specified
Source: gfx/graphics.d.ts:133
| Parameter | Type | Description |
|---|---|---|
| pos | Vector2 |
The position to draw the text |
| text | string |
The text to draw |
| size | number |
The size of the text in pixels |
| color | Color |
The color of the text |
void
drawTextFull( area:
Rect, text:string, size:number, color:Color, alignment:TextAlignment, verticalAlignment:VerticalAlignment):void
A full verison of drawText, where you can specify the bounds of the text and the alignment
Source: gfx/graphics.d.ts:144
| Parameter | Type | Description |
|---|---|---|
| area | Rect |
The place to render the text |
| text | string |
The text to render |
| size | number |
The size of the text |
| color | Color |
The color of the text |
| alignment | TextAlignment |
The horizontal alignment |
| verticalAlignment | VerticalAlignment |
The vertical alignment |
void
drawTexture( texture:
Texture, pos:Vector2, sizeX:number, sizeY:number, color?:Color):void
Draws a texture.
Source: gfx/graphics.d.ts:154
| Parameter | Type | Description |
|---|---|---|
| texture | Texture |
The texture to draw |
| pos | Vector2 |
The position to draw the texture |
| sizeX | number |
The size of the texture in pixels |
| sizeY | number |
The size of the texture in pixels |
| color? | Color |
The overlay color of the texture (defaults to white) |
void
Source: gfx/graphics.d.ts:119
| Parameter | Type |
|---|---|
| rect | Rect |
| color | Color |
| radius? | number |
void
getTextSize(text:
string, textSize:number):Vector2
Source: gfx/graphics.d.ts:121
| Parameter | Type |
|---|---|
| text | string |
| textSize | number |
restoreClippingRect():
void
Source: gfx/graphics.d.ts:124
void
setClippingRect(rect:
Rect):void
Source: gfx/graphics.d.ts:123
| Parameter | Type |
|---|---|
| rect | Rect |
void
use(renderer: "dx" | "minecraft"):
void
Source: gfx/graphics.d.ts:117
| Parameter | Type | Description |
|---|---|---|
| renderer | "dx" | "minecraft" | "dx": uses Direct2D/DirectWrite, "minecraft": use the Minecraft renderer |
void