diff --git a/src/Classes/Cel.gd b/src/Classes/Cel.gd index 46786dc39..aa6e67186 100644 --- a/src/Classes/Cel.gd +++ b/src/Classes/Cel.gd @@ -4,7 +4,7 @@ class_name Cel extends Reference # The "image" variable is where the image data of each cel are. -var image : Image +var image : Image setget image_changed var image_texture : ImageTexture var opacity : float @@ -16,3 +16,9 @@ func _init(_image := Image.new(), _opacity := 1.0, _image_texture : ImageTexture image_texture = ImageTexture.new() image = _image opacity = _opacity + + +func image_changed(value : Image) -> void: + image = value + if !image.is_empty(): + image_texture.create_from_image(image, 0)