a while ago i made a quick test for editable images that loads an image from a link, it used to work but after revisiting it today and attempting to fix it to work with the new EditableImage api i cant get it to actualy draw to the imagelabel
i dont know if i did something wrong with my methods or if its just bugged.
here is a video of the issue:
They changed a lot of API related things recently.
Here’s how a new editable image code sample should look like:
--LocalScript inside an image label
local label = script.Parent
local image = game.AssetService:CreateEditableImage()
label.ImageContent = Content.fromObject(image)
--for debugging
--you can change the image dimensions by modifying the size property
print("EditableImage dimensions:", image.Size)
--example code for creating a red square
local x, y = 200, 200
local b = buffer.create(x*y*4)
--set up the pixels buffer
for i = 0, x-1 do
for j = 0, y-1 do
local flat = (j*(x-1)+i)*4 --flat coordinates
buffer.writeu8(b, flat, 255) --R
buffer.writeu8(b, flat+1, 0) --G
buffer.writeu8(b, flat+2, 0) --B
buffer.writeu8(b, flat+3, 255) --A(non transparent)
end
end
--write the pixels buffer
image:WritePixelsBuffer(Vector2.zero, Vector2.new(x, y), b)
Keep in mind it may also break after a while because they’re constantly updating editable images. This also means that systems like ChatGPT(or really any AI tool) are really likely to give you false information.