mirror of
https://github.com/tonytins/CozyPixelStudio.git
synced 2025-05-05 16:34:48 -04:00
Created TopMenuContainer.tscn and ViewportContainer.gd
This commit is contained in:
parent
2190c21d9d
commit
55527501d0
5 changed files with 128 additions and 117 deletions
|
@ -2,6 +2,5 @@
|
|||
|
||||
[ext_resource path="res://src/Canvas.gd" type="Script" id=1]
|
||||
|
||||
|
||||
[node name="Canvas" type="Node2D"]
|
||||
script = ExtResource( 1 )
|
||||
|
|
|
@ -522,14 +522,6 @@ func _on_ImportSprites_popup_hide() -> void:
|
|||
_can_draw_true()
|
||||
|
||||
|
||||
func _on_ViewportContainer_mouse_entered() -> void:
|
||||
Global.has_focus = true
|
||||
|
||||
|
||||
func _on_ViewportContainer_mouse_exited() -> void:
|
||||
Global.has_focus = false
|
||||
|
||||
|
||||
func _can_draw_true() -> void:
|
||||
Global.dialog_open(false)
|
||||
|
||||
|
|
118
src/Main.tscn
118
src/Main.tscn
|
@ -1,8 +1,8 @@
|
|||
[gd_scene load_steps=41 format=2]
|
||||
[gd_scene load_steps=42 format=2]
|
||||
|
||||
[ext_resource path="res://assets/themes/dark/theme.tres" type="Theme" id=1]
|
||||
[ext_resource path="res://src/Main.gd" type="Script" id=2]
|
||||
[ext_resource path="res://assets/themes/dark/top_menu_style.tres" type="StyleBox" id=3]
|
||||
[ext_resource path="res://src/UI/TopMenuContainer.tscn" type="PackedScene" id=3]
|
||||
[ext_resource path="res://assets/graphics/dark_themes/tools/rectselect.png" type="Texture" id=4]
|
||||
[ext_resource path="res://assets/graphics/dark_themes/tools/eraser_r.png" type="Texture" id=5]
|
||||
[ext_resource path="res://assets/graphics/dark_themes/tools/pencil_l.png" type="Texture" id=6]
|
||||
|
@ -21,6 +21,7 @@
|
|||
[ext_resource path="res://src/UI/SecondViewport.gd" type="Script" id=19]
|
||||
[ext_resource path="res://src/UI/Timeline/AnimationTimeline.tscn" type="PackedScene" id=20]
|
||||
[ext_resource path="res://src/Palette/PalettePanelContainer.tscn" type="PackedScene" id=21]
|
||||
[ext_resource path="res://src/UI/ViewportContainer.gd" type="Script" id=22]
|
||||
[ext_resource path="res://assets/graphics/dark_themes/tools/zoom.png" type="Texture" id=23]
|
||||
[ext_resource path="res://src/UI/BrushButton.tscn" type="PackedScene" id=26]
|
||||
[ext_resource path="res://src/UI/Dialogs/SplashDialog.tscn" type="PackedScene" id=27]
|
||||
|
@ -91,108 +92,7 @@ __meta__ = {
|
|||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="TopMenuContainer" type="Panel" parent="MenuAndUI"]
|
||||
margin_right = 1280.0
|
||||
margin_bottom = 28.0
|
||||
rect_min_size = Vector2( 0, 28 )
|
||||
custom_styles/panel = ExtResource( 3 )
|
||||
|
||||
[node name="MenuItems" type="HBoxContainer" parent="MenuAndUI/TopMenuContainer"]
|
||||
margin_left = 2.0
|
||||
margin_top = 4.0
|
||||
margin_right = 1010.0
|
||||
|
||||
[node name="FileMenu" type="MenuButton" parent="MenuAndUI/TopMenuContainer/MenuItems"]
|
||||
margin_right = 29.0
|
||||
margin_bottom = 21.0
|
||||
mouse_default_cursor_shape = 2
|
||||
text = "File"
|
||||
switch_on_hover = true
|
||||
|
||||
[node name="EditMenu" type="MenuButton" parent="MenuAndUI/TopMenuContainer/MenuItems"]
|
||||
margin_left = 33.0
|
||||
margin_right = 64.0
|
||||
margin_bottom = 21.0
|
||||
mouse_default_cursor_shape = 2
|
||||
text = "Edit"
|
||||
switch_on_hover = true
|
||||
|
||||
[node name="ViewMenu" type="MenuButton" parent="MenuAndUI/TopMenuContainer/MenuItems"]
|
||||
margin_left = 68.0
|
||||
margin_right = 104.0
|
||||
margin_bottom = 21.0
|
||||
mouse_default_cursor_shape = 2
|
||||
text = "View"
|
||||
switch_on_hover = true
|
||||
|
||||
[node name="ImageMenu" type="MenuButton" parent="MenuAndUI/TopMenuContainer/MenuItems"]
|
||||
margin_left = 108.0
|
||||
margin_right = 152.0
|
||||
margin_bottom = 21.0
|
||||
mouse_default_cursor_shape = 2
|
||||
text = "Image"
|
||||
switch_on_hover = true
|
||||
|
||||
[node name="HelpMenu" type="MenuButton" parent="MenuAndUI/TopMenuContainer/MenuItems"]
|
||||
margin_left = 156.0
|
||||
margin_right = 191.0
|
||||
margin_bottom = 21.0
|
||||
mouse_default_cursor_shape = 2
|
||||
text = "Help"
|
||||
switch_on_hover = true
|
||||
|
||||
[node name="TopLabels" type="HBoxContainer" parent="MenuAndUI/TopMenuContainer"]
|
||||
anchor_left = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 1.0
|
||||
margin_left = -65.5
|
||||
margin_right = 65.5
|
||||
custom_constants/separation = 20
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="ZoomLevel" type="Label" parent="MenuAndUI/TopMenuContainer/TopLabels"]
|
||||
margin_top = 6.0
|
||||
margin_right = 60.0
|
||||
margin_bottom = 21.0
|
||||
rect_min_size = Vector2( 60, 0 )
|
||||
text = "781 %"
|
||||
align = 2
|
||||
|
||||
[node name="CursorPosition" type="Label" parent="MenuAndUI/TopMenuContainer/TopLabels"]
|
||||
margin_left = 80.0
|
||||
margin_top = 6.0
|
||||
margin_right = 120.0
|
||||
margin_bottom = 21.0
|
||||
text = "[64×64]"
|
||||
align = 2
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="MenuAndUI/TopMenuContainer"]
|
||||
anchor_left = 1.0
|
||||
anchor_top = 0.5
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 0.5
|
||||
margin_left = -330.0
|
||||
margin_top = -14.0
|
||||
margin_bottom = 14.0
|
||||
grow_horizontal = 2
|
||||
size_flags_vertical = 0
|
||||
alignment = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="CurrentFrame" type="Label" parent="MenuAndUI/TopMenuContainer/HBoxContainer"]
|
||||
margin_left = 113.0
|
||||
margin_top = 6.0
|
||||
margin_right = 216.0
|
||||
margin_bottom = 21.0
|
||||
text = "Current Frame: 1/1"
|
||||
valign = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
[node name="TopMenuContainer" parent="MenuAndUI" instance=ExtResource( 3 )]
|
||||
|
||||
[node name="UI" type="HBoxContainer" parent="MenuAndUI"]
|
||||
margin_top = 28.0
|
||||
|
@ -431,6 +331,7 @@ focus_mode = 2
|
|||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
stretch = true
|
||||
script = ExtResource( 22 )
|
||||
|
||||
[node name="Viewport" type="Viewport" parent="MenuAndUI/UI/CanvasAndTimeline/HViewportContainer/ViewportAndRulers/HSplitContainer/ViewportandVerticalRuler/ViewportContainer"]
|
||||
size = Vector2( 880, 470 )
|
||||
|
@ -467,6 +368,7 @@ margin_right = 902.0
|
|||
margin_bottom = 470.0
|
||||
size_flags_vertical = 3
|
||||
stretch = true
|
||||
script = ExtResource( 22 )
|
||||
|
||||
[node name="Viewport" type="Viewport" parent="MenuAndUI/UI/CanvasAndTimeline/HViewportContainer/ViewportAndRulers/HSplitContainer/ViewportContainer2"]
|
||||
size = Vector2( 0, 470 )
|
||||
|
@ -692,10 +594,10 @@ visible = false
|
|||
[connection signal="mouse_entered" from="MenuAndUI/UI/CanvasAndTimeline/HViewportContainer/ViewportAndRulers/HorizontalRuler" to="MenuAndUI/UI/CanvasAndTimeline/HViewportContainer/ViewportAndRulers/HorizontalRuler" method="_on_HorizontalRuler_mouse_entered"]
|
||||
[connection signal="pressed" from="MenuAndUI/UI/CanvasAndTimeline/HViewportContainer/ViewportAndRulers/HorizontalRuler" to="MenuAndUI/UI/CanvasAndTimeline/HViewportContainer/ViewportAndRulers/HorizontalRuler" method="_on_HorizontalRuler_pressed"]
|
||||
[connection signal="pressed" from="MenuAndUI/UI/CanvasAndTimeline/HViewportContainer/ViewportAndRulers/HSplitContainer/ViewportandVerticalRuler/VerticalRuler" to="MenuAndUI/UI/CanvasAndTimeline/HViewportContainer/ViewportAndRulers/HSplitContainer/ViewportandVerticalRuler/VerticalRuler" method="_on_VerticalRuler_pressed"]
|
||||
[connection signal="mouse_entered" from="MenuAndUI/UI/CanvasAndTimeline/HViewportContainer/ViewportAndRulers/HSplitContainer/ViewportandVerticalRuler/ViewportContainer" to="." method="_on_ViewportContainer_mouse_entered"]
|
||||
[connection signal="mouse_exited" from="MenuAndUI/UI/CanvasAndTimeline/HViewportContainer/ViewportAndRulers/HSplitContainer/ViewportandVerticalRuler/ViewportContainer" to="." method="_on_ViewportContainer_mouse_exited"]
|
||||
[connection signal="mouse_entered" from="MenuAndUI/UI/CanvasAndTimeline/HViewportContainer/ViewportAndRulers/HSplitContainer/ViewportContainer2" to="." method="_on_ViewportContainer_mouse_entered"]
|
||||
[connection signal="mouse_exited" from="MenuAndUI/UI/CanvasAndTimeline/HViewportContainer/ViewportAndRulers/HSplitContainer/ViewportContainer2" to="." method="_on_ViewportContainer_mouse_exited"]
|
||||
[connection signal="mouse_entered" from="MenuAndUI/UI/CanvasAndTimeline/HViewportContainer/ViewportAndRulers/HSplitContainer/ViewportandVerticalRuler/ViewportContainer" to="MenuAndUI/UI/CanvasAndTimeline/HViewportContainer/ViewportAndRulers/HSplitContainer/ViewportandVerticalRuler/ViewportContainer" method="_on_ViewportContainer_mouse_entered"]
|
||||
[connection signal="mouse_exited" from="MenuAndUI/UI/CanvasAndTimeline/HViewportContainer/ViewportAndRulers/HSplitContainer/ViewportandVerticalRuler/ViewportContainer" to="MenuAndUI/UI/CanvasAndTimeline/HViewportContainer/ViewportAndRulers/HSplitContainer/ViewportandVerticalRuler/ViewportContainer" method="_on_ViewportContainer_mouse_exited"]
|
||||
[connection signal="mouse_entered" from="MenuAndUI/UI/CanvasAndTimeline/HViewportContainer/ViewportAndRulers/HSplitContainer/ViewportContainer2" to="MenuAndUI/UI/CanvasAndTimeline/HViewportContainer/ViewportAndRulers/HSplitContainer/ViewportContainer2" method="_on_ViewportContainer_mouse_entered"]
|
||||
[connection signal="mouse_exited" from="MenuAndUI/UI/CanvasAndTimeline/HViewportContainer/ViewportAndRulers/HSplitContainer/ViewportContainer2" to="MenuAndUI/UI/CanvasAndTimeline/HViewportContainer/ViewportAndRulers/HSplitContainer/ViewportContainer2" method="_on_ViewportContainer_mouse_exited"]
|
||||
[connection signal="brush_selected" from="BrushesPopup/TabContainer/File/FileBrushContainer/PixelBrushButton" to="." method="_on_Brush_Selected"]
|
||||
[connection signal="brush_selected" from="BrushesPopup/TabContainer/File/FileBrushContainer/CircleBrushButton" to="." method="_on_Brush_Selected"]
|
||||
[connection signal="brush_selected" from="BrushesPopup/TabContainer/File/FileBrushContainer/FilledCircleBrushButton" to="." method="_on_Brush_Selected"]
|
||||
|
|
109
src/UI/TopMenuContainer.tscn
Normal file
109
src/UI/TopMenuContainer.tscn
Normal file
|
@ -0,0 +1,109 @@
|
|||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://assets/themes/dark/top_menu_style.tres" type="StyleBox" id=1]
|
||||
|
||||
[node name="TopMenuContainer" type="Panel"]
|
||||
margin_right = 1280.0
|
||||
margin_bottom = 28.0
|
||||
rect_min_size = Vector2( 0, 28 )
|
||||
custom_styles/panel = ExtResource( 1 )
|
||||
|
||||
[node name="MenuItems" type="HBoxContainer" parent="."]
|
||||
margin_left = 2.0
|
||||
margin_top = 4.0
|
||||
margin_right = 1010.0
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="FileMenu" type="MenuButton" parent="MenuItems"]
|
||||
margin_right = 29.0
|
||||
margin_bottom = 21.0
|
||||
mouse_default_cursor_shape = 2
|
||||
text = "File"
|
||||
switch_on_hover = true
|
||||
|
||||
[node name="EditMenu" type="MenuButton" parent="MenuItems"]
|
||||
margin_left = 33.0
|
||||
margin_right = 64.0
|
||||
margin_bottom = 21.0
|
||||
mouse_default_cursor_shape = 2
|
||||
text = "Edit"
|
||||
switch_on_hover = true
|
||||
|
||||
[node name="ViewMenu" type="MenuButton" parent="MenuItems"]
|
||||
margin_left = 68.0
|
||||
margin_right = 104.0
|
||||
margin_bottom = 21.0
|
||||
mouse_default_cursor_shape = 2
|
||||
text = "View"
|
||||
switch_on_hover = true
|
||||
|
||||
[node name="ImageMenu" type="MenuButton" parent="MenuItems"]
|
||||
margin_left = 108.0
|
||||
margin_right = 152.0
|
||||
margin_bottom = 21.0
|
||||
mouse_default_cursor_shape = 2
|
||||
text = "Image"
|
||||
switch_on_hover = true
|
||||
|
||||
[node name="HelpMenu" type="MenuButton" parent="MenuItems"]
|
||||
margin_left = 156.0
|
||||
margin_right = 191.0
|
||||
margin_bottom = 21.0
|
||||
mouse_default_cursor_shape = 2
|
||||
text = "Help"
|
||||
switch_on_hover = true
|
||||
|
||||
[node name="TopLabels" type="HBoxContainer" parent="."]
|
||||
anchor_left = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 1.0
|
||||
margin_left = -65.5
|
||||
margin_right = 65.5
|
||||
custom_constants/separation = 20
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="ZoomLevel" type="Label" parent="TopLabels"]
|
||||
margin_top = 6.0
|
||||
margin_right = 60.0
|
||||
margin_bottom = 21.0
|
||||
rect_min_size = Vector2( 60, 0 )
|
||||
text = "781 %"
|
||||
align = 2
|
||||
|
||||
[node name="CursorPosition" type="Label" parent="TopLabels"]
|
||||
margin_left = 80.0
|
||||
margin_top = 6.0
|
||||
margin_right = 120.0
|
||||
margin_bottom = 21.0
|
||||
text = "[64×64]"
|
||||
align = 2
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="."]
|
||||
anchor_left = 1.0
|
||||
anchor_top = 0.5
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 0.5
|
||||
margin_left = -330.0
|
||||
margin_top = -14.0
|
||||
margin_bottom = 14.0
|
||||
grow_horizontal = 2
|
||||
size_flags_vertical = 0
|
||||
alignment = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="CurrentFrame" type="Label" parent="HBoxContainer"]
|
||||
margin_left = 113.0
|
||||
margin_top = 6.0
|
||||
margin_right = 216.0
|
||||
margin_bottom = 21.0
|
||||
text = "Current Frame: 1/1"
|
||||
valign = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
9
src/UI/ViewportContainer.gd
Normal file
9
src/UI/ViewportContainer.gd
Normal file
|
@ -0,0 +1,9 @@
|
|||
extends ViewportContainer
|
||||
|
||||
|
||||
func _on_ViewportContainer_mouse_entered() -> void:
|
||||
Global.has_focus = true
|
||||
|
||||
|
||||
func _on_ViewportContainer_mouse_exited() -> void:
|
||||
Global.has_focus = false
|
Loading…
Add table
Reference in a new issue