1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-02-07 19:09:50 +00:00
Pixelorama/src/Classes/Cel.gd
Manolis Papadeas c6b9a1fb82
Format code and add static checks (#599)
* gdformat .

* Lint code - Part 1

* Format code - Part 2

* Lint code - Part 2

Trying to fix the max allowed line length errors

* Add normal_map_invert_y to the image .import files

Because of Godot 3.4

* Do not call private methods outside of the script's scope

Lint code - Part 3

* Format code - Part 3

* Fixed more line length exceeded errors - Lint code Part 3

* Export array of licenses - Lint code part 4

* Clean hint_tooltip code from Global

Removes a lot of lines of code

* Create static-checks.yml

* Fix FreeType's license
2021-11-25 14:48:30 +02:00

25 lines
657 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, _image_texture: ImageTexture = null) -> void:
if _image_texture:
image_texture = _image_texture
else:
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)