mirror of
https://github.com/tonytins/CozyPixelStudio.git
synced 2025-07-06 19:24:42 -04:00
Merge branch 'master' into text-tool
This commit is contained in:
commit
60700ada36
12 changed files with 78 additions and 114 deletions
|
@ -1,9 +1,17 @@
|
|||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://assets/graphics/brush_button.png" type="Texture" id=1]
|
||||
[ext_resource path="res://src/Tools/Base.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://src/Tools/Bucket.gd" type="Script" id=3]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id=1]
|
||||
bg_color = Color( 1, 1, 1, 1 )
|
||||
border_color = Color( 1, 1, 1, 1 )
|
||||
corner_radius_top_left = 5
|
||||
corner_radius_top_right = 5
|
||||
corner_radius_bottom_right = 5
|
||||
corner_radius_bottom_left = 5
|
||||
anti_aliasing = false
|
||||
|
||||
[node name="ToolOptions" instance=ExtResource( 2 )]
|
||||
script = ExtResource( 3 )
|
||||
|
||||
|
@ -56,14 +64,17 @@ margin_right = 108.0
|
|||
margin_bottom = 208.0
|
||||
size_flags_horizontal = 4
|
||||
|
||||
[node name="Type" type="TextureButton" parent="FillPattern" index="0"]
|
||||
[node name="Type" type="Button" parent="FillPattern" index="0"]
|
||||
margin_left = 27.0
|
||||
margin_right = 59.0
|
||||
margin_bottom = 32.0
|
||||
rect_min_size = Vector2( 32, 32 )
|
||||
hint_tooltip = "Select a brush"
|
||||
mouse_default_cursor_shape = 2
|
||||
size_flags_horizontal = 4
|
||||
texture_normal = ExtResource( 1 )
|
||||
custom_styles/hover = SubResource( 1 )
|
||||
custom_styles/pressed = SubResource( 1 )
|
||||
custom_styles/normal = SubResource( 1 )
|
||||
|
||||
[node name="Texture" type="TextureRect" parent="FillPattern/Type" index="0"]
|
||||
margin_right = 32.0
|
||||
|
|
|
@ -1,9 +1,17 @@
|
|||
[gd_scene load_steps=4 format=2]
|
||||
|
||||
[ext_resource path="res://assets/graphics/brush_button.png" type="Texture" id=1]
|
||||
[ext_resource path="res://src/Tools/Base.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://src/Tools/Draw.gd" type="Script" id=3]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id=1]
|
||||
bg_color = Color( 1, 1, 1, 1 )
|
||||
border_color = Color( 1, 1, 1, 1 )
|
||||
corner_radius_top_left = 5
|
||||
corner_radius_top_right = 5
|
||||
corner_radius_bottom_right = 5
|
||||
corner_radius_bottom_left = 5
|
||||
anti_aliasing = false
|
||||
|
||||
[node name="ToolOptions" instance=ExtResource( 2 )]
|
||||
script = ExtResource( 3 )
|
||||
|
||||
|
@ -13,15 +21,17 @@ margin_right = 116.0
|
|||
margin_bottom = 50.0
|
||||
alignment = 1
|
||||
|
||||
[node name="Type" type="TextureButton" parent="Brush" index="0"]
|
||||
margin_left = 1.0
|
||||
margin_right = 37.0
|
||||
[node name="Type" type="Button" parent="Brush" index="0"]
|
||||
margin_left = 3.0
|
||||
margin_right = 35.0
|
||||
margin_bottom = 32.0
|
||||
rect_min_size = Vector2( 36, 32 )
|
||||
rect_min_size = Vector2( 32, 32 )
|
||||
hint_tooltip = "Select a brush"
|
||||
mouse_default_cursor_shape = 2
|
||||
size_flags_horizontal = 0
|
||||
texture_normal = ExtResource( 1 )
|
||||
custom_styles/hover = SubResource( 1 )
|
||||
custom_styles/pressed = SubResource( 1 )
|
||||
custom_styles/normal = SubResource( 1 )
|
||||
|
||||
[node name="Texture" type="TextureRect" parent="Brush/Type" index="0"]
|
||||
margin_right = 32.0
|
||||
|
@ -33,8 +43,8 @@ __meta__ = {
|
|||
}
|
||||
|
||||
[node name="Size" type="SpinBox" parent="Brush" index="1"]
|
||||
margin_left = 41.0
|
||||
margin_right = 115.0
|
||||
margin_left = 39.0
|
||||
margin_right = 113.0
|
||||
margin_bottom = 32.0
|
||||
mouse_default_cursor_shape = 2
|
||||
min_value = 1.0
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -6,6 +6,9 @@ onready var animation_timer : Timer = $AnimationTimer
|
|||
|
||||
func _draw() -> void:
|
||||
var current_project : Project = Global.current_project
|
||||
if frame >= current_project.frames.size():
|
||||
frame = current_project.current_frame
|
||||
|
||||
$AnimationTimer.wait_time = Global.animation_timer.wait_time
|
||||
|
||||
if animation_timer.is_stopped():
|
||||
|
|
|
@ -1,39 +1,9 @@
|
|||
[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()
|
||||
"
|
||||
[ext_resource path="res://src/UI/Canvas/CanvasPreview.gd" type="Script" id=1]
|
||||
|
||||
[node name="CanvasPreview" type="Node2D"]
|
||||
script = SubResource( 1 )
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="AnimationTimer" type="Timer" parent="."]
|
||||
[connection signal="timeout" from="AnimationTimer" to="." method="_on_AnimationTimer_timeout"]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
extends TextureButton
|
||||
extends BaseButton
|
||||
|
||||
|
||||
var pattern := Patterns.Pattern.new()
|
||||
|
|
|
@ -1,24 +1,25 @@
|
|||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://assets/graphics/brush_button.png" type="Texture" id=1]
|
||||
[ext_resource path="res://src/UI/PatternButton.gd" type="Script" id=2]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id=1]
|
||||
bg_color = Color( 1, 1, 1, 1 )
|
||||
border_color = Color( 1, 1, 1, 1 )
|
||||
corner_radius_top_left = 5
|
||||
corner_radius_top_right = 5
|
||||
corner_radius_bottom_right = 5
|
||||
corner_radius_bottom_left = 5
|
||||
anti_aliasing = false
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
[node name="PatternButton" type="TextureButton"]
|
||||
[node name="PatternButton" type="Button"]
|
||||
margin_right = 32.0
|
||||
margin_bottom = 32.0
|
||||
rect_min_size = Vector2( 3, 0 )
|
||||
rect_min_size = Vector2( 32, 32 )
|
||||
custom_styles/hover = SubResource( 1 )
|
||||
custom_styles/pressed = SubResource( 1 )
|
||||
custom_styles/normal = SubResource( 1 )
|
||||
button_mask = 7
|
||||
texture_normal = ExtResource( 1 )
|
||||
stretch_mode = 5
|
||||
script = ExtResource( 2 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="PatternTexture" type="TextureRect" parent="."]
|
||||
margin_right = 32.0
|
||||
|
|
|
@ -20,8 +20,8 @@ func _on_Tabs_tab_close(tab : int) -> void:
|
|||
|
||||
func _on_Tabs_reposition_active_tab_request(idx_to : int) -> void:
|
||||
var temp = Global.projects[Global.current_project_index]
|
||||
Global.projects[Global.current_project_index] = Global.projects[idx_to]
|
||||
Global.projects[idx_to] = temp
|
||||
Global.projects.erase(temp)
|
||||
Global.projects.insert(idx_to, temp)
|
||||
|
||||
# Change save paths
|
||||
var temp_save_path = OpenSave.current_save_paths[Global.current_project_index]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue