Drag and drop palette files to open them

This commit is contained in:
OverloadedOrama 2020-06-17 16:47:24 +03:00
parent f7cc9a8104
commit 25d9aca0c4
4 changed files with 11 additions and 7 deletions

View file

@ -13,15 +13,12 @@ onready var texture_rect : TextureRect = $VBoxContainer/CenterContainer/TextureR
onready var spritesheet_options = $VBoxContainer/HBoxContainer/SpritesheetOptions
func _ready() -> void:
spritesheet_options.get_node("HorizontalFrames").max_value = min(spritesheet_options.get_node("HorizontalFrames").max_value, image.get_size().x)
spritesheet_options.get_node("VerticalFrames").max_value = min(spritesheet_options.get_node("VerticalFrames").max_value, image.get_size().y)
func _on_PreviewDialog_about_to_show() -> void:
var img_texture := ImageTexture.new()
img_texture.create_from_image(image)
texture_rect.texture = img_texture
spritesheet_options.get_node("HorizontalFrames").max_value = min(spritesheet_options.get_node("HorizontalFrames").max_value, image.get_size().x)
spritesheet_options.get_node("VerticalFrames").max_value = min(spritesheet_options.get_node("VerticalFrames").max_value, image.get_size().y)
func _on_PreviewDialog_popup_hide() -> void:

View file

@ -7,6 +7,7 @@ margin_right = 200.0
margin_bottom = 70.0
rect_min_size = Vector2( 550, 70 )
popup_exclusive = true
window_title = "Import Options"
resizable = true
script = ExtResource( 1 )
__meta__ = {