You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
societer_utils/Previsualisation.gd

23 lines
514 B

extends TextureRect
var image
func create_image(points):
image = Image.new()
image.create(get_parent().get_parent().width, get_parent().get_parent().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_Control_new_poisson(points):
create_image(points)
update_texture()