Class "Image"⚓︎
Info
You can get this class by using the following function:
Functions⚓︎
GetWidth ()⚓︎
number GetWidth ( )⚓︎
The logical width of the image.
UV coordinates for a SourceQuad are based on this dimension.
GetHeight ()⚓︎
number GetHeight ( )⚓︎
The logical height of the image.
UV coordinates for a SourceQuad are based on this dimension.
GetPaddedWidth ()⚓︎
number GetPaddedWidth ( )⚓︎
The number of pixels stored per row in memory, including any extra padding added for alignment. This value may be greater than Width.
UV coordinates used in the shader are based on this dimension.
GetPaddedHeight ()⚓︎
number GetPaddedHeight ( )⚓︎
The number of pixels rows in memory, including any extra padding added for alignment. This value may be greater than Height.
UV coordinates used in the shader are based on this dimension.
GetName ()⚓︎
string GetName ( )⚓︎
GetTexelRegion ()⚓︎
string GetTexelRegion ( integer x, integer y, integer width, integer height )⚓︎
Returns the image content for the specified quad.
The returned string contains raw binary data representing 32-bit floating-point values. Every group of 4 consecutive floats represents one pixel in RGBA order:
Render ()⚓︎
void Render ( SourceQuad sourceQuad, DestinationQuad destinationQuad, KColor color, Color colorMod = Color() )⚓︎
RenderWithShader ()⚓︎
void RenderWithShader ( SourceQuad sourceQuad, DestinationQuad destinationQuad, KColor color, Shader shader, table shaderParams )⚓︎
The shaderParams are represented as a table<string, (number | number[])>.
- Use a number for float attributes.
- Use a numeric array (
number[]) for vecN attributes, with N being the length.
The function throws an error if any attribute is missing or has an invalid type.