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.
23 lines
574 B
23 lines
574 B
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()
|
|
|