1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-31 15:39:49 +00:00
Pixelorama/src/UI/CanvasPreviewContainer.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

24 lines
870 B
GDScript

extends PanelContainer
onready var canvas_preview = $HBoxContainer/PreviewViewportContainer/Viewport/CanvasPreview
onready var camera: Camera2D = $HBoxContainer/PreviewViewportContainer/Viewport/CameraPreview
onready var play_button: Button = $HBoxContainer/VBoxContainer/PlayButton
func _on_PreviewZoomSlider_value_changed(value: float) -> void:
camera.zoom = -Vector2(value, value)
camera.save_values_to_project()
camera.update_transparent_checker_offset()
func _on_PlayButton_toggled(button_pressed: bool) -> void:
if button_pressed:
if Global.current_project.frames.size() <= 1:
play_button.pressed = false
return
canvas_preview.animation_timer.start()
Global.change_button_texturerect(play_button.get_child(0), "pause.png")
else:
canvas_preview.animation_timer.stop()
Global.change_button_texturerect(play_button.get_child(0), "play.png")