extends TextureRect var image func create_image(points): var width = get_parent().get_parent().polygon_data.width var height = get_parent().get_parent().polygon_data.height image = Image.new() image.create(width, height, false, Image.FORMAT_RGBA8) image.fill(Color.white) image.lock() for point in points: image.set_pixel(point.x, point.y, Color.black) image.unlock() func update_texture(): var texture = ImageTexture.new() texture.create_from_image(image) set_texture(texture) func _on_Poisson_new_truncs(truncs): create_image(truncs) update_texture()