1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-02-08 03:19:49 +00:00
Pixelorama/src/Classes/Cel.gd
Manolis Papadeas 57bb7929df Fixed issue with linked cels where, if you had linked cels in one layer and then linked more cels of the same frame in another layer, their previews did not update automatically
Cel's image_texture was being reset due to the creation of new Cel instances in CelButton.gd (line 113)
2021-07-22 02:25:00 +03:00

19 lines
510 B
GDScript

class_name Cel extends Reference
# A class for cel properties.
# The term "cel" comes from "celluloid" (https://en.wikipedia.org/wiki/Cel).
# The "image" variable is where the image data of each cel are.
var image : Image
var image_texture : ImageTexture
var opacity : float
func _init(_image := Image.new(), _opacity := 1.0, _image_texture : ImageTexture = null) -> void:
if _image_texture:
image_texture = _image_texture
else:
image_texture = ImageTexture.new()
image = _image
opacity = _opacity