Hi, I can create an image, set it to a TextureRect, appear to draw on it, and then save it, but no line drawing? Thankyou
var fn = "poo.png"
#var obj = TextureRect.new()
var colorBG = Color(0.8, 0.8, 0.8, 1.0) # RGBA
var color = Color(1.0, 0.0, 0.0, 1.0) # RGBA
var img_width = 100
var img_height = 100
var img = Image.new()
img.create(img_width, img_height, false, Image.FORMAT_RGBA8)
img.fill(colorBG)
img.lock()
img.set_pixel(50, 50, color) # Works
img.unlock()
var texture = ImageTexture.new()
texture.create_from_image(img)
obj.texture = texture
obj.draw_line(Vector2(1,1), Vector2(50, -50), Color(255, 0, 0), 5)
#var img2 = texture.get_data()
var img2 = obj.texture.get_data()
var err = img2.save_png(fn)
if err != OK:
print("Error saving image")