mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-02-08 03:19:49 +00:00
The structure of the .pxo files is now consisted of a JSON-structured metadata part, where all the data that can be stored as text are, and a binary part, that contain all the actual image data for each cel and project brush. This makes it easier for users to understand the .pxo structure, easier to add more changes without having to check versions for backwards compatibility, easier to be opened by third-party apps and it allows us to make an "Export JSON metadata" option, that will export just the metadata in JSON format, without the binary image data. It's backwards compatible and .pxo files from as far as v0.5 are still supported.
22 lines
564 B
GDScript
22 lines
564 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 setget image_changed
|
|
var image_texture : ImageTexture
|
|
var opacity : float
|
|
|
|
|
|
func _init(_image := Image.new(), _opacity := 1.0) -> void:
|
|
image_texture = ImageTexture.new()
|
|
self.image = _image
|
|
opacity = _opacity
|
|
|
|
|
|
func image_changed(value : Image) -> void:
|
|
image = value
|
|
if !image.is_empty():
|
|
image_texture.create_from_image(image, 0)
|