1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-18 17:19:50 +00:00

use grid container

This commit is contained in:
Variable 2023-11-01 09:32:55 +05:00 committed by GitHub
parent eec1482e5f
commit 8ac9ac2aae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 22 deletions

View file

@ -6,6 +6,7 @@ extends PanelContainer
@onready var play_button := $"%PlayButton" as Button
@onready var start_frame := $"%StartFrame" as ValueSlider
@onready var end_frame := $"%EndFrame" as ValueSlider
@onready var options := $VBox/Animation/Options as VBoxContainer
func _ready() -> void:
@ -43,12 +44,12 @@ func _on_OptionButton_item_selected(index: int) -> void:
play_button.button_pressed = false
canvas_preview.mode = index
if index == 0:
$VBox/Animation/VBoxContainer/Options.visible = false
options.visible = false
canvas_preview.transparent_checker.fit_rect(
Rect2(Vector2.ZERO, Global.current_project.size)
)
else:
$VBox/Animation/VBoxContainer/Options.visible = true
options.visible = true
canvas_preview.queue_redraw()

View file

@ -67,7 +67,7 @@ stretch = true
transparent_bg = true
handle_input_locally = false
canvas_item_default_texture_filter = 0
size = Vector2i(308, 139)
size = Vector2i(308, 135)
render_target_update_mode = 4
[node name="TransparentChecker" parent="VBox/HBox/PreviewViewportContainer/SubViewport" instance=ExtResource("1")]
@ -84,9 +84,9 @@ zoom = Vector2(0.15, 0.15)
script = ExtResource("3")
index = 2
[node name="Animation" type="HBoxContainer" parent="VBox"]
[node name="Animation" type="GridContainer" parent="VBox"]
layout_mode = 2
alignment = 1
columns = 2
[node name="PlayButton" type="Button" parent="VBox/Animation" groups=["UIButtons"]]
unique_name_in_owner = true
@ -109,19 +109,16 @@ offset_bottom = 6.0
mouse_default_cursor_shape = 2
texture = ExtResource("6")
[node name="VBoxContainer" type="VBoxContainer" parent="VBox/Animation"]
[node name="Mode" type="HBoxContainer" parent="VBox/Animation"]
layout_mode = 2
size_flags_horizontal = 3
[node name="Mode" type="HBoxContainer" parent="VBox/Animation/VBoxContainer"]
layout_mode = 2
[node name="Label" type="Label" parent="VBox/Animation/VBoxContainer/Mode"]
[node name="Label" type="Label" parent="VBox/Animation/Mode"]
layout_mode = 2
text = "Animation mode:"
vertical_alignment = 1
[node name="OptionButton" type="OptionButton" parent="VBox/Animation/VBoxContainer/Mode"]
[node name="OptionButton" type="OptionButton" parent="VBox/Animation/Mode"]
layout_mode = 2
size_flags_horizontal = 3
mouse_default_cursor_shape = 2
@ -133,17 +130,20 @@ popup/item_0/id = 0
popup/item_1/text = "Current frame as spritesheet"
popup/item_1/id = 1
[node name="Options" parent="VBox/Animation/VBoxContainer" instance=ExtResource("7")]
[node name="Spacer" type="Control" parent="VBox/Animation"]
layout_mode = 2
[node name="Options" parent="VBox/Animation" instance=ExtResource("7")]
visible = false
layout_mode = 2
text = "Spritesheet options"
[node name="GridContainer" type="GridContainer" parent="VBox/Animation/VBoxContainer/Options"]
[node name="GridContainer" type="GridContainer" parent="VBox/Animation/Options"]
visible = false
layout_mode = 2
columns = 2
[node name="HFrames" type="TextureProgressBar" parent="VBox/Animation/VBoxContainer/Options/GridContainer"]
[node name="HFrames" type="TextureProgressBar" parent="VBox/Animation/Options/GridContainer"]
custom_minimum_size = Vector2(0, 24)
layout_mode = 2
size_flags_horizontal = 3
@ -161,7 +161,7 @@ stretch_margin_bottom = 3
script = ExtResource("8")
prefix = "Horizontal frames:"
[node name="VFrames" type="TextureProgressBar" parent="VBox/Animation/VBoxContainer/Options/GridContainer"]
[node name="VFrames" type="TextureProgressBar" parent="VBox/Animation/Options/GridContainer"]
custom_minimum_size = Vector2(0, 24)
layout_mode = 2
size_flags_horizontal = 3
@ -179,7 +179,7 @@ stretch_margin_bottom = 3
script = ExtResource("8")
prefix = "Vertical frames:"
[node name="StartFrame" type="TextureProgressBar" parent="VBox/Animation/VBoxContainer/Options/GridContainer"]
[node name="StartFrame" type="TextureProgressBar" parent="VBox/Animation/Options/GridContainer"]
unique_name_in_owner = true
custom_minimum_size = Vector2(0, 24)
layout_mode = 2
@ -198,7 +198,7 @@ stretch_margin_bottom = 3
script = ExtResource("8")
prefix = "Start frame:"
[node name="EndFrame" type="TextureProgressBar" parent="VBox/Animation/VBoxContainer/Options/GridContainer"]
[node name="EndFrame" type="TextureProgressBar" parent="VBox/Animation/Options/GridContainer"]
unique_name_in_owner = true
custom_minimum_size = Vector2(0, 24)
layout_mode = 2
@ -221,8 +221,8 @@ prefix = "End frame:"
[connection signal="mouse_entered" from="VBox/HBox/PreviewViewportContainer" to="." method="_on_PreviewViewportContainer_mouse_entered"]
[connection signal="mouse_exited" from="VBox/HBox/PreviewViewportContainer" to="." method="_on_PreviewViewportContainer_mouse_exited"]
[connection signal="toggled" from="VBox/Animation/PlayButton" to="." method="_on_PlayButton_toggled"]
[connection signal="item_selected" from="VBox/Animation/VBoxContainer/Mode/OptionButton" to="." method="_on_OptionButton_item_selected"]
[connection signal="value_changed" from="VBox/Animation/VBoxContainer/Options/GridContainer/HFrames" to="." method="_on_HFrames_value_changed"]
[connection signal="value_changed" from="VBox/Animation/VBoxContainer/Options/GridContainer/VFrames" to="." method="_on_VFrames_value_changed"]
[connection signal="value_changed" from="VBox/Animation/VBoxContainer/Options/GridContainer/StartFrame" to="." method="_on_StartFrame_value_changed"]
[connection signal="value_changed" from="VBox/Animation/VBoxContainer/Options/GridContainer/EndFrame" to="." method="_on_EndFrame_value_changed"]
[connection signal="item_selected" from="VBox/Animation/Mode/OptionButton" to="." method="_on_OptionButton_item_selected"]
[connection signal="value_changed" from="VBox/Animation/Options/GridContainer/HFrames" to="." method="_on_HFrames_value_changed"]
[connection signal="value_changed" from="VBox/Animation/Options/GridContainer/VFrames" to="." method="_on_VFrames_value_changed"]
[connection signal="value_changed" from="VBox/Animation/Options/GridContainer/StartFrame" to="." method="_on_StartFrame_value_changed"]
[connection signal="value_changed" from="VBox/Animation/Options/GridContainer/EndFrame" to="." method="_on_EndFrame_value_changed"]