Open Asterune
EditableImage

EditableImage

Reads, writes, and draws image pixels at runtime.

Behavior

EditableImage reads, writes, and draws image pixels at runtime.

Summary

Members8
Properties2
Methods6

Properties

ContentId

EditableImage.ContentId: string

The generated content identifier used to display this editable image.

Size

EditableImage.Size: Vector2

The image width and height in pixels.

Methods

Clear

EditableImage:Clear(color: Color3?, transparency: number?): ()

Fills the image with the supplied color and transparency.

DrawCircle

EditableImage:DrawCircle(center: Vector2, radius: number, color: Color3, transparency: number?): ()

Draws a circle using pixel coordinates for its center and radius.

DrawLine

EditableImage:DrawLine(from: Vector2, to: Vector2, color: Color3, transparency: number?, thickness: number?): ()

Draws a line between pixel coordinates with the supplied color and optional thickness.

DrawRectangle

EditableImage:DrawRectangle(position: Vector2, size: Vector2, color: Color3, transparency: number?): ()

Draws a rectangle at the supplied pixel position and size.

ReadPixels

EditableImage:ReadPixels(position: Vector2, size: Vector2): buffer

Returns RGBA bytes for the rectangular pixel region.

WritePixels

EditableImage:WritePixels(position: Vector2, size: Vector2, pixels: buffer | { number }): ()

Writes a rectangular pixel region. A buffer contains RGBA bytes; a numeric array contains RGBA components from 0 to 1. Position and size must be integer pixel coordinates. The data length must match the region.

Operators

__tostring · __type

Used by

AssetService