Reference API Roblox

Engine API

Website

Related

Reference API Roblox

EditableImage

Instance which allows for the runtime creation and manipulation of images.

Member index 16

HistoryMember
601Size: Vector2
601Copy(min: Vector2, max: Vector2): EditableImage
601Crop(min: Vector2, max: Vector2): null
632DrawCircle(center: Vector2, radius: int, color: Color3, transparency: float, combineType: ImageCombineType): null
601DrawImage(position: Vector2, image: EditableImage, combineType: ImageCombineType): null
632DrawLine(p1: Vector2, p2: Vector2, color: Color3, transparency: float, combineType: ImageCombineType): null
616DrawProjectionImage(mesh: EditableMesh, projection: Dictionary, brushConfig: Dictionary): null
632DrawRectangle(position: Vector2, size: Vector2, color: Color3, transparency: float, combineType: ImageCombineType): null
601ReadPixels(position: Vector2, size: Vector2): Array
640ReadPixelsBuffer(position: Vector2, size: Vector2): buffer
601Resize(size: Vector2): null
601Rotate(degrees: float, changeSize: bool): null
601WritePixels(position: Vector2, size: Vector2, pixels: Array): null
640WritePixelsBuffer(position: Vector2, size: Vector2, buffer: buffer): null
inherited from Instance
553Archivable: bool
635Capabilities: SecurityCapabilities
553ClassName: string
553Name: string
553Parent: Instance
635Sandboxed: bool
616UniqueId: UniqueId
553className: string
576AddTag(tag: string): null
573ClearAllChildren(): null
462Clone(): Instance
573Destroy(): null
486FindFirstAncestor(name: string): Instance
486FindFirstAncestorOfClass(className: string): Instance
486FindFirstAncestorWhichIsA(className: string): Instance
486FindFirstChild(name: string, recursive: bool = false): Instance
486FindFirstChildOfClass(className: string): Instance
486FindFirstChildWhichIsA(className: string, recursive: bool = false): Instance
486FindFirstDescendant(name: string): Instance
563GetActor(): Actor
486GetAttribute(attribute: string): Variant
462GetAttributeChangedSignal(attribute: string): RBXScriptSignal
631GetAttributes(): Dictionary
486GetChildren(): Objects
462GetDebugId(scopeLength: int = 4): string
486GetDescendants(): Array
486GetFullName(): string
462GetPropertyChangedSignal(property: string): RBXScriptSignal
641GetStyled(name: string): Variant
576GetTags(): Array
576HasTag(tag: string): bool
486IsA(className: string): bool
486IsAncestorOf(descendant: Instance): bool
486IsDescendantOf(ancestor: Instance): bool
580IsPropertyModified(name: string): bool
573Remove(): null
576RemoveTag(tag: string): null
580ResetPropertyToDefault(name: string): null
573SetAttribute(attribute: string, value: Variant): null
462WaitForChild(childName: string, timeOut: double): Instance
553children(): Objects
553clone(): Instance
573destroy(): null
553findFirstChild(name: string, recursive: bool = false): Instance
553getChildren(): Objects
462isA(className: string): bool
553isDescendantOf(ancestor: Instance): bool
573remove(): null
462AncestryChanged(child: Instance, parent: Instance)
462AttributeChanged(attribute: string)
462Changed(property: string)
462ChildAdded(child: Instance)
462ChildRemoved(child: Instance)
462DescendantAdded(descendant: Instance)
462DescendantRemoving(descendant: Instance)
500Destroying()
553childAdded(child: Instance)

Description

EditableImage allows for the runtime creation and manipulation of images. It can be created from an existing image using AssetService:CreateEditableImageAsync(), or a blank EditableImage can be created with Instance.new(). EditableImage overrides the image/texture displayed when parented to certain objects as follows:

ObjectOverridden
MeshPartMeshPart.TextureID
ImageLabelImageLabel.Image
ImageButtonImageButton.Image
DecalDecal.Texture
TextureTexture.Texture
SurfaceAppearanceSurfaceAppearance.ColorMap

The EditableImage coordinate system is relative to the top left of the image:

  • Top-left: (0, 0)
  • Bottom-right: (Size.X - 1, Size.Y - 1)

When publishing an object via AssetService:PromptCreateAssetAsync() that has a property overridden by a child EditableImage, the editable image will be published as an image and the overridden property will be set to the new asset ID.

History 24

Members 16

Copy

Parameters (2)
minVector2
maxVector2
Returns (1)
EditableImage

Copies a subregion of the EditableImage to a new EditableImage.

History 1

Crop

Parameters (2)
minVector2
maxVector2
Returns (1)
null

Crops the EditableImage to the specified subregion.

History 1

DrawCircle

Parameters (5)
centerVector2
radiusint
colorColor3
transparencyfloat
combineTypeImageCombineType
Returns (1)
null

Draws a circle at the specified point on the EditableImage. If the circle is semi-transparent, it will be blended with the pixels behind it using source over blending.

History 2

DrawImage

Parameters (3)
positionVector2
imageEditableImage
combineTypeImageCombineType
Returns (1)
null

Draws another EditableImage into this EditableImage at the given position. Positions outside the canvas bounds are allowed such that only part of the new image is drawn.

History 1

DrawLine

Parameters (5)
p1Vector2
p2Vector2
colorColor3
transparencyfloat
combineTypeImageCombineType
Returns (1)
null

Draws an anti-aliased line on the EditableImage one pixel thick between the two provided points.

History 2

DrawProjectionImage

Parameters (3)
meshEditableMesh
projectionDictionary
brushConfigDictionary
Returns (1)
null

History 1

DrawRectangle

Parameters (5)
positionVector2
sizeVector2
colorColor3
transparencyfloat
combineTypeImageCombineType
Returns (1)
null

Draws a rectangle on the EditableImage of the given size at the given top-left position.

History 2

ReadPixels

Parameters (2)
positionVector2
sizeVector2
Returns (1)
Array

Reads a rectangular region of pixels. The pixels will be returned as a flat array where each pixel is represented by four numbers between 0 and 1 (red, green, blue, and alpha respectively). Note that this method uses alpha instead of transparency, unlike the EditableImage drawing methods.

This function has a custom internal state. It may behave in a non-standard way.

History 1

Tags: [CustomLuaState]

ReadPixelsBuffer

Parameters (2)
positionVector2
sizeVector2
Returns (1)
buffer
This function has a custom internal state. It may behave in a non-standard way.

History 1

Tags: [CustomLuaState]

Resize

Parameters (1)
sizeVector2
Returns (1)
null

Resizes the contents and canvas of the EditableImage using bilinear interpolation. Max allowed size is 1024×1024.

History 1

Rotate

Parameters (2)
degreesfloat
changeSizebool
Returns (1)
null

Rotates the EditableImage around its center using bilinear interpolation.

History 1

Size

TypeDefault
Vector2512, 512

Size of the EditableImage in pixels. The maximum size is 1024×1024 and attempting to set this property to a larger size will cause it to be clamped at 1024.

Setting this property changes the canvas size of the editable image but does not resize the contents. If changing to a larger size, new pixels will be set to an RGBA value of [0, 0, 0, 0]. If changing to a smaller size, existing pixels will be cropped. Consider using Resize() to update the contents while changing the size.

History 1

WritePixels

Parameters (3)
positionVector2
sizeVector2
pixelsArray
Returns (1)
null

Writes a rectangular region of pixels into the EditableImage. The pixels are provided as a flat array where each pixel is represented by four numbers between 0 and 1 (red, green, blue, and alpha respectively). Note that this method uses alpha instead of transparency, unlike other EditableImage drawing methods.

This function has a custom internal state. It may behave in a non-standard way.

History 1

Tags: [CustomLuaState]

WritePixelsBuffer

Parameters (3)
positionVector2
sizeVector2
bufferbuffer
Returns (1)
null
This function has a custom internal state. It may behave in a non-standard way.

History 1

Tags: [CustomLuaState]

Settings