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

Move Canvas related files to a "Canvas" folder under "UI"

This commit is contained in:
OverloadedOrama 2020-08-18 16:21:31 +03:00
parent fd97191d56
commit 92332cc52e
14 changed files with 71 additions and 22 deletions

View file

@ -22,7 +22,7 @@ _global_script_classes=[ {
"base": "Node2D",
"class": "Canvas",
"language": "GDScript",
"path": "res://src/Canvas.gd"
"path": "res://src/UI/Canvas/Canvas.gd"
}, {
"base": "Reference",
"class": "Cel",
@ -42,7 +42,7 @@ _global_script_classes=[ {
"base": "Line2D",
"class": "Guide",
"language": "GDScript",
"path": "res://src/UI/Rulers/Guide.gd"
"path": "res://src/UI/Canvas/Rulers/Guide.gd"
}, {
"base": "Reference",
"class": "Layer",
@ -77,7 +77,7 @@ _global_script_classes=[ {
"base": "Guide",
"class": "SymmetryGuide",
"language": "GDScript",
"path": "res://src/UI/Rulers/SymmetryGuide.gd"
"path": "res://src/UI/Canvas/Rulers/SymmetryGuide.gd"
} ]
_global_script_class_icons={
"AnimationTag": "",

View file

@ -1,7 +1,7 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://src/Canvas.gd" type="Script" id=1]
[ext_resource path="res://src/UI/Grid.gd" type="Script" id=2]
[ext_resource path="res://src/UI/Canvas/Canvas.gd" type="Script" id=1]
[ext_resource path="res://src/UI/Canvas/Grid.gd" type="Script" id=2]
[node name="Canvas" type="Node2D"]
script = ExtResource( 1 )

View file

@ -0,0 +1,39 @@
[gd_scene load_steps=2 format=2]
[sub_resource type="GDScript" id=1]
script/source = "extends Node2D
var frame : int = 0
onready var animation_timer : Timer = $AnimationTimer
func _draw() -> void:
var current_project : Project = Global.current_project
$AnimationTimer.wait_time = Global.animation_timer.wait_time
if animation_timer.is_stopped():
frame = current_project.current_frame
var current_cels : Array = current_project.frames[frame].cels
# Draw current frame layers
for i in range(current_cels.size()):
var modulate_color := Color(1, 1, 1, current_cels[i].opacity)
if i < current_project.layers.size() and current_project.layers[i].visible:
draw_texture(current_cels[i].image_texture, Vector2.ZERO, modulate_color)
func _on_AnimationTimer_timeout() -> void:
var current_project : Project = Global.current_project
if frame < current_project.frames.size() - 1:
frame += 1
else:
frame = 0
update()
"
[node name="CanvasPreview" type="Node2D"]
script = SubResource( 1 )
[node name="AnimationTimer" type="Timer" parent="."]
[connection signal="timeout" from="AnimationTimer" to="." method="_on_AnimationTimer_timeout"]

View file

@ -1,9 +0,0 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://src/UI/CanvasPreview.gd" type="Script" id=1]
[node name="CanvasPreview" type="Node2D"]
script = ExtResource( 1 )
[node name="AnimationTimer" type="Timer" parent="."]
[connection signal="timeout" from="AnimationTimer" to="." method="_on_AnimationTimer_timeout"]

View file

@ -1,9 +1,9 @@
[gd_scene load_steps=8 format=2]
[ext_resource path="res://src/UI/CanvasPreview.tscn" type="PackedScene" id=1]
[ext_resource path="res://src/UI/Canvas/CanvasPreview.tscn" type="PackedScene" id=1]
[ext_resource path="res://src/UI/TransparentChecker.tscn" type="PackedScene" id=2]
[ext_resource path="res://src/UI/CanvasPreviewContainer.gd" type="Script" id=3]
[ext_resource path="res://src/CameraMovement.gd" type="Script" id=4]
[ext_resource path="res://src/UI/Canvas/CameraMovement.gd" type="Script" id=4]
[ext_resource path="res://src/Shaders/TransparentChecker.shader" type="Shader" id=5]
[ext_resource path="res://assets/graphics/dark_themes/timeline/play.png" type="Texture" id=7]
@ -12,6 +12,11 @@ shader = ExtResource( 5 )
shader_param/size = 10.0
shader_param/color1 = Color( 0.7, 0.7, 0.7, 1 )
shader_param/color2 = Color( 1, 1, 1, 1 )
shader_param/offset = Vector2( 0, 0 )
shader_param/scale = Vector2( 0, 0 )
shader_param/rect_size = Vector2( 0, 0 )
shader_param/follow_movement = false
shader_param/follow_scale = false
[node name="CanvasPreviewContainer" type="HBoxContainer"]
margin_right = 332.0
@ -32,13 +37,27 @@ margin_top = 7.0
margin_right = 27.0
margin_bottom = 157.0
[node name="Label" type="Label" parent="SettingsContainer/VBoxContainer"]
margin_right = 20.0
margin_bottom = 14.0
text = "+"
align = 1
[node name="PreviewZoomSlider" type="VSlider" parent="SettingsContainer/VBoxContainer"]
margin_top = 18.0
margin_right = 16.0
margin_bottom = 126.0
margin_bottom = 108.0
mouse_default_cursor_shape = 2
size_flags_vertical = 3
step = 0.01
[node name="Label2" type="Label" parent="SettingsContainer/VBoxContainer"]
margin_top = 112.0
margin_right = 20.0
margin_bottom = 126.0
text = "-"
align = 1
[node name="PlayButton" type="Button" parent="SettingsContainer/VBoxContainer" groups=[
"UIButtons",
]]

View file

@ -1,12 +1,12 @@
[gd_scene load_steps=23 format=2]
[ext_resource path="res://src/UI/ToolButtons.gd" type="Script" id=1]
[ext_resource path="res://src/UI/CanvasPreview.tscn" type="PackedScene" id=2]
[ext_resource path="res://src/UI/Canvas/CanvasPreview.tscn" type="PackedScene" id=2]
[ext_resource path="res://src/UI/Tabs.gd" type="Script" id=3]
[ext_resource path="res://src/UI/Rulers/VerticalRuler.gd" type="Script" id=4]
[ext_resource path="res://src/UI/Canvas/Rulers/VerticalRuler.gd" type="Script" id=4]
[ext_resource path="res://src/UI/TransparentChecker.tscn" type="PackedScene" id=5]
[ext_resource path="res://src/UI/Rulers/HorizontalRuler.gd" type="Script" id=6]
[ext_resource path="res://src/CameraMovement.gd" type="Script" id=7]
[ext_resource path="res://src/UI/Canvas/Rulers/HorizontalRuler.gd" type="Script" id=6]
[ext_resource path="res://src/UI/Canvas/CameraMovement.gd" type="Script" id=7]
[ext_resource path="res://src/SelectionRectangle.gd" type="Script" id=8]
[ext_resource path="res://assets/graphics/dark_themes/tools/bucket.png" type="Texture" id=10]
[ext_resource path="res://assets/graphics/dark_themes/tools/colorpicker.png" type="Texture" id=11]
@ -17,7 +17,7 @@
[ext_resource path="res://src/UI/CanvasPreviewContainer.tscn" type="PackedScene" id=16]
[ext_resource path="res://src/UI/ColorAndToolOptions.tscn" type="PackedScene" id=17]
[ext_resource path="res://src/UI/Timeline/AnimationTimeline.tscn" type="PackedScene" id=18]
[ext_resource path="res://src/Canvas.tscn" type="PackedScene" id=19]
[ext_resource path="res://src/UI/Canvas/Canvas.tscn" type="PackedScene" id=19]
[ext_resource path="res://src/Palette/PalettePanelContainer.tscn" type="PackedScene" id=20]
[ext_resource path="res://assets/graphics/dark_themes/tools/zoom.png" type="Texture" id=21]
[ext_resource path="res://src/UI/ViewportContainer.gd" type="Script" id=23]