Opening .pxo files directly with Pixelorama is now also supported

Also added "-> void" to the methods that did not already have it
This commit is contained in:
OverloadedOrama 2020-02-09 18:06:03 +02:00
parent 45a31faa7b
commit 9e7a3059f2
5 changed files with 25 additions and 20 deletions

View file

@ -4,21 +4,21 @@ var texture : ImageTexture
var aux_img : Image
var layer : Image
func _ready():
func _ready() -> void:
texture = ImageTexture.new()
texture.flags = 0
aux_img = Image.new()
$VBoxContainer/HBoxContainer2/OptionButton.add_item("Rotxel")
$VBoxContainer/HBoxContainer2/OptionButton.add_item("Nearest neighbour")
func set_sprite(sprite : Image):
func set_sprite(sprite : Image) -> void:
aux_img.copy_from(sprite)
layer = sprite
texture.create_from_image(aux_img, 0)
$VBoxContainer/TextureRect.texture = texture
func _on_HSlider_value_changed(_value):
func _on_HSlider_value_changed(_value) -> void:
rotate()
$VBoxContainer/HBoxContainer/SpinBox.value = $VBoxContainer/HBoxContainer/HSlider.value
@ -27,7 +27,7 @@ func _on_SpinBox_value_changed(_value):
$VBoxContainer/HBoxContainer/HSlider.value = $VBoxContainer/HBoxContainer/SpinBox.value
func _on_RotateImage_confirmed():
func _on_RotateImage_confirmed() -> void:
Global.canvas.handle_undo("Draw")
match $VBoxContainer/HBoxContainer2/OptionButton.text:
"Rotxel":
@ -37,7 +37,7 @@ func _on_RotateImage_confirmed():
Global.canvas.handle_redo("Draw")
$VBoxContainer/HBoxContainer/HSlider.value = 0
func rotate():
func rotate() -> void:
var sprite : Image = Image.new()
sprite.copy_from(aux_img)
match $VBoxContainer/HBoxContainer2/OptionButton.text:
@ -48,9 +48,9 @@ func rotate():
texture.create_from_image(sprite, 0)
func _on_OptionButton_item_selected(_id):
func _on_OptionButton_item_selected(_id) -> void:
rotate()
func _on_RotateImage_about_to_show():
func _on_RotateImage_about_to_show() -> void:
$VBoxContainer/HBoxContainer/HSlider.value = 0