extends TextureRect var image func create_image(points): var width = get_parent().get_parent().data.width var height = get_parent().get_parent().data.height image = Image.new() image.create(width, height, false, Image.FORMAT_RGBA8) image.fill(Color.white) image.lock() for i in width * height: if(points[i]): image.set_pixel(i % width, i / height, Color.black) image.unlock() func update_texture(): var texture = ImageTexture.new() texture.create_from_image(image) set_texture(texture) func _on_Control_new_poisson(points): create_image(points) update_texture()