Skip to content

Commit

Permalink
0.7.0 version
Browse files Browse the repository at this point in the history
  • Loading branch information
ArMM1998 committed Feb 3, 2024
1 parent b1b8bec commit 78877b8
Show file tree
Hide file tree
Showing 13 changed files with 589 additions and 119 deletions.
16 changes: 11 additions & 5 deletions Classes/puyoElement.gd
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,10 @@ func _process(_delta):
transform_helper.scale = Vector2(1,1)
transform_helper.position = Vector2(0,0)
transform_helper.rotation_degrees = 0

var initialsaveDefaults = saveDefaults
saveDefaults = false
self.update()

saveDefaults = initialsaveDefaults
rotation_degrees = angle
if not inherit_angle:
transform_helper.rotation_degrees = angle
Expand Down Expand Up @@ -257,11 +258,12 @@ func animate(current_time, anim_idx, screen_size, loop_update_fix = false):
#time = round(time)
var current_kf
var next_kf
var old_default = defaultSettings
var old_default = defaultSettings.duplicate(true)
saveDefaults = false


var time = current_time

#for motion in animation list
if animation_list.size()-1 < anim_idx:
pass
Expand Down Expand Up @@ -358,9 +360,12 @@ func animate(current_time, anim_idx, screen_size, loop_update_fix = false):
setColorBR(value)





defaultSettings = old_default





func setRender(value):
render = value
Expand Down Expand Up @@ -452,6 +457,7 @@ func setPositionY(value):
positionY = value

if saveDefaults:
# print("why")
defaultSettings["positionY"] = positionY

func getAngle():
Expand Down
Binary file modified Graphics/camera_depth.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Graphics/recording.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions Graphics/recording.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://gcv6skd11wyl"
path="res://.godot/imported/recording.png-2790dd51136d96a4591356310b44f14c.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://Graphics/recording.png"
dest_files=["res://.godot/imported/recording.png-2790dd51136d96a4591356310b44f14c.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
49 changes: 27 additions & 22 deletions Shaders/tint_add.gdshader
Original file line number Diff line number Diff line change
@@ -1,34 +1,39 @@
shader_type canvas_item;

render_mode blend_add;
uniform vec4 topleft:source_color;
uniform vec4 topright:source_color;
uniform vec4 bottomleft:source_color;
uniform vec4 bottomright:source_color;
uniform vec4 color:source_color;
uniform vec4 topleft : source_color;
uniform vec4 topright : source_color;
uniform vec4 bottomleft : source_color;
uniform vec4 bottomright : source_color;
uniform vec4 color : source_color;
uniform bool flipx;
uniform bool flipy;

// Define the range for the shader
uniform vec2 range_min;
uniform vec2 range_max;

void fragment() {
vec4 texture_color = texture(TEXTURE, UV);
vec4 texture_color = texture(TEXTURE, UV);
// Compute the gradient coordinates based on the range_min and range_max, and the flipx and flipy variables
vec2 gradient_uv = (UV - range_min) / (range_max - range_min);
if (flipx) {
gradient_uv.x = 1.0 - gradient_uv.x;
}
if (flipy) {
gradient_uv.y = 1.0 - gradient_uv.y;
}

vec4 top = mix(topleft, topright, gradient_uv.x);
vec4 bottom = mix(bottomleft, bottomright, gradient_uv.x);
vec4 gradient = mix(top, bottom, gradient_uv.y);
vec4 mixed = gradient * color;

// Compute the gradient coordinates based on the range_min and range_max, and the flipx and flipy variables
vec2 gradient_uv = (UV - range_min) / (range_max - range_min);
if (flipx) {
gradient_uv.x = 1.0 - gradient_uv.x;
}
if (flipy) {
gradient_uv.y = 1.0 - gradient_uv.y;
}
// Calculate the luminance of the pixel and use it as the alpha value
float luminance = dot(texture_color.rgb, vec3(0.299, 0.587, 0.114));
mixed.a *= luminance; // Use luminance as alpha


vec4 top = mix(topleft, topright, gradient_uv.x);
vec4 bottom = mix(bottomleft, bottomright, gradient_uv.x);
vec4 gradient = mix(top, bottom, gradient_uv.y);
vec4 mixed = gradient * color;
vec4 final_color = vec4(texture_color.rgb, texture_color.a);
COLOR = final_color * mixed;
}
// Set the final color with the modified alpha value
vec4 final_color = vec4(texture_color.rgb, texture_color.a);
COLOR = final_color * mixed;
}
98 changes: 83 additions & 15 deletions canvas_viewport.tscn
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_scene load_steps=13 format=3 uid="uid://d02nd2drmop08"]
[gd_scene load_steps=16 format=3 uid="uid://d02nd2drmop08"]

[ext_resource type="Texture2D" uid="uid://iqctjs0vvuy1" path="res://Graphics/viewportbg.png" id="1_8n31f"]
[ext_resource type="Script" path="res://scripts/canvasViewportLogic.gd" id="1_b3f5c"]
Expand All @@ -11,6 +11,8 @@
[ext_resource type="Texture2D" uid="uid://bwxg0ytrc60pb" path="res://Graphics/snap_grid.png" id="8_ydadp"]
[ext_resource type="Texture2D" uid="uid://06uwq1xpr36d" path="res://Graphics/fill_screen.png" id="9_x5n8r"]
[ext_resource type="Texture2D" uid="uid://dm51oe6v3q0c2" path="res://Graphics/icon.png" id="11_s2u58"]
[ext_resource type="Texture2D" uid="uid://cbfg0b4ukfiy6" path="res://Graphics/camera_depth.png" id="12_svw4f"]
[ext_resource type="Texture2D" uid="uid://gcv6skd11wyl" path="res://Graphics/recording.png" id="13_cs83v"]

[sub_resource type="LabelSettings" id="LabelSettings_tdl1p"]
font_size = 11
Expand All @@ -19,33 +21,68 @@ shadow_size = 8
shadow_color = Color(0.160784, 0.160784, 0.160784, 1)
shadow_offset = Vector2(0, 0)

[sub_resource type="ViewportTexture" id="ViewportTexture_ny6hq"]
viewport_path = NodePath("SubViewportContainer/SubViewport/Center/Canvas/extra_cam_container/extra_cam_viewport")

[node name="CanvasViewport" type="Control"]
clip_contents = true
layout_mode = 3
anchors_preset = 0
focus_mode = 1
script = ExtResource("1_b3f5c")

[node name="Center" type="Node2D" parent="."]
position = Vector2(376, 192)
[node name="SubViewportContainer" type="SubViewportContainer" parent="."]
layout_mode = 0
offset_right = 512.0
offset_bottom = 512.0
stretch = true

[node name="Canvas" type="Node2D" parent="Center"]
[node name="SubViewport" type="SubViewport" parent="SubViewportContainer"]
transparent_bg = true
handle_input_locally = false
render_target_update_mode = 4

[node name="transformhelper" type="Sprite2D" parent="Center/Canvas"]
visible = false
position = Vector2(-376, -192)
texture = ExtResource("11_s2u58")

[node name="checkbg" type="TextureRect" parent="."]
[node name="checkbg" type="TextureRect" parent="SubViewportContainer/SubViewport"]
visibility_layer = 2
z_index = -4096
z_as_relative = false
layout_mode = 0
offset_left = -16.0
offset_right = 784.0
offset_bottom = 440.0
texture = ExtResource("1_8n31f")
stretch_mode = 1

[node name="Camera2D" type="Camera2D" parent="SubViewportContainer/SubViewport"]
position = Vector2(264, 40)
anchor_mode = 0

[node name="Center" type="Node2D" parent="SubViewportContainer/SubViewport"]

[node name="Canvas" type="Node2D" parent="SubViewportContainer/SubViewport/Center"]

[node name="transformhelper" type="Sprite2D" parent="SubViewportContainer/SubViewport/Center/Canvas"]
visible = false
texture = ExtResource("11_s2u58")

[node name="extra_cam_container" type="SubViewportContainer" parent="SubViewportContainer/SubViewport/Center/Canvas"]
z_index = -4096
z_as_relative = false
texture_filter = 1
offset_right = 512.0
offset_bottom = 512.0
size_flags_horizontal = 3

[node name="extra_cam_viewport" type="SubViewport" parent="SubViewportContainer/SubViewport/Center/Canvas/extra_cam_container"]
transparent_bg = true
handle_input_locally = false
canvas_cull_mask = 4294967293
render_target_update_mode = 4

[node name="extra_cam" type="Camera2D" parent="SubViewportContainer/SubViewport/Center/Canvas/extra_cam_container/extra_cam_viewport"]
anchor_mode = 0
enabled = false
editor_draw_screen = false

[node name="posScreenRect" type="Marker2D" parent="."]
z_index = 4096
z_as_relative = false
Expand Down Expand Up @@ -81,16 +118,13 @@ antialiased = true
position = Vector2(136, 80)

[node name="Y" type="Line2D" parent="posAxis"]
z_index = -4096
z_as_relative = false
points = PackedVector2Array(0, -4092, 0, 4092)
width = 1.0
default_color = Color(0.458824, 0.333333, 0.878431, 1)
antialiased = true

[node name="X" type="Line2D" parent="posAxis"]
z_index = -4096
z_as_relative = false
points = PackedVector2Array(-4092, 0, -168, 0, 4092, 0)
width = 1.0
default_color = Color(0.823529, 0.329412, 0.360784, 1)
Expand Down Expand Up @@ -254,9 +288,39 @@ theme_override_colors/font_pressed_color = Color(0.572549, 0.690196, 1, 1)
theme_override_font_sizes/font_size = 11
icon = ExtResource("9_x5n8r")

[node name="Button" type="Button" parent="."]
layout_mode = 0
offset_left = 8.0
offset_top = 40.0
offset_right = 32.0
offset_bottom = 64.0
icon = ExtResource("12_svw4f")

[node name="Window" type="Window" parent="."]
mode = 3
title = "Preview"
initial_position = 2
visible = false

[node name="color_rect" type="ColorRect" parent="Window"]
offset_right = 40.0
offset_bottom = 40.0
color = Color(0, 0, 0, 1)

[node name="TextureRect" type="TextureRect" parent="Window"]
offset_right = 40.0
offset_bottom = 40.0
texture = SubResource("ViewportTexture_ny6hq")
expand_mode = 1

[node name="recording" type="Sprite2D" parent="."]
visible = false
position = Vector2(176, 16)
texture = ExtResource("13_cs83v")

[connection signal="focus_entered" from="." to="." method="_on_focus_entered"]
[connection signal="focus_exited" from="." to="." method="_on_focus_exited"]
[connection signal="gui_input" from="checkbg" to="." method="_on_checkbg_gui_input"]
[connection signal="gui_input" from="SubViewportContainer/SubViewport/checkbg" to="." method="_on_checkbg_gui_input"]
[connection signal="pressed" from="zoomLabel" to="." method="resetZoom"]
[connection signal="gui_input" from="ElementStuff/posMoveScaleTop/ScaleTop" to="." method="_on_scale_top_gui_input"]
[connection signal="gui_input" from="ElementStuff/posMoveScaleBottom/ScaleBottom" to="." method="_on_scale_bottom"]
Expand All @@ -265,3 +329,7 @@ icon = ExtResource("9_x5n8r")
[connection signal="gui_input" from="ElementStuff/posRotate/Rotate" to="." method="_on_angle_gui_input"]
[connection signal="toggled" from="LockToGrid" to="." method="_on_lock_to_grid_toggled"]
[connection signal="pressed" from="maximize_view" to="." method="_on_maximize_view_pressed"]
[connection signal="gui_input" from="Button" to="." method="_on_Button_gui_input"]
[connection signal="close_requested" from="Window" to="." method="_on_window_close_requested"]
[connection signal="size_changed" from="Window" to="." method="_on_window_resized"]
[connection signal="gui_input" from="Window/TextureRect" to="." method="_on_texture_rect_gui_input"]
16 changes: 16 additions & 0 deletions main_scene.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,15 @@ text = "60FPS
"
horizontal_alignment = 2

[node name="preview" type="Button" parent="Layer2_Panels/PanelTop"]
layout_mode = 0
offset_left = 266.0
offset_top = 4.0
offset_right = 382.0
offset_bottom = 35.0
scale = Vector2(0.75, 0.75)
text = "Open Preview"

[node name="PanelBottom" parent="Layer2_Panels" instance=ExtResource("6_b6dm2")]

[node name="PanelRight" type="Panel" parent="Layer2_Panels"]
Expand Down Expand Up @@ -528,6 +537,12 @@ title = "Changelog"
initial_position = 2
ok_button_text = "Close"

[node name="ColorRect" type="ColorRect" parent="Layer3_Popups"]
visible = false
offset_right = 40.0
offset_bottom = 40.0
color = Color(0.0196078, 0.0196078, 0.0196078, 0.494118)

[node name="directory_watcher" type="Node" parent="."]

[node name="HTTPRequest" type="HTTPRequest" parent="."]
Expand All @@ -536,6 +551,7 @@ script = ExtResource("20_r06tp")
[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="."]

[connection signal="selected_element" from="Layer1_Canvas/CanvasViewport" to="." method="_on_canvas_viewport_selected_element"]
[connection signal="pressed" from="Layer2_Panels/PanelTop/preview" to="." method="_on_preview_pressed"]
[connection signal="toggled" from="Layer2_Panels/toggle_panelLeft" to="Layer2_Panels" method="panelLeftToggle"]
[connection signal="toggled" from="Layer2_Panels/toggle_panelRight" to="Layer2_Panels" method="panelRightToggle"]
[connection signal="toggled" from="Layer2_Panels/toggle_panelBottom" to="Layer2_Panels" method="panelBottomToggle"]
Expand Down
28 changes: 27 additions & 1 deletion panel_bottom.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,30 @@ offset_right = 152.0
offset_bottom = 8.0
texture_normal = ExtResource("7_vu2xa")

[node name="ease_in" type="SpinBox" parent="keyframeSettings/curvePanel/curve"]
layout_mode = 0
offset_left = 7.0
offset_top = -26.0
offset_right = 90.0625
offset_bottom = 5.0
scale = Vector2(0.8, 0.8)
min_value = -1200.0
max_value = 1200.0
allow_greater = true
allow_lesser = true

[node name="ease_out" type="SpinBox" parent="keyframeSettings/curvePanel/curve"]
layout_mode = 0
offset_left = 71.0
offset_top = 121.0
offset_right = 154.063
offset_bottom = 152.0
scale = Vector2(0.8, 0.8)
min_value = -1200.0
max_value = 1200.0
allow_greater = true
allow_lesser = true

[node name="tweening_btn" type="Button" parent="keyframeSettings"]
layout_mode = 0
offset_left = 112.0
Expand Down Expand Up @@ -507,7 +531,7 @@ allow_reselect = true
layout_mode = 0
offset_left = 264.0
offset_top = 56.0
offset_right = 1288.0
offset_right = 1016.0
offset_bottom = 248.0
color = Color(0.14902, 0.14902, 0.14902, 0.647059)

Expand Down Expand Up @@ -544,6 +568,8 @@ icon = ExtResource("8_yg2g2")
[connection signal="gui_input" from="keyframeSettings/curvePanel/curve/ease_in_btn" to="." method="_on_ease_in_btn_gui_input"]
[connection signal="pressed" from="keyframeSettings/curvePanel/curve/ease_in_btn" to="." method="_on_ease_in_btn_pressed"]
[connection signal="gui_input" from="keyframeSettings/curvePanel/curve/ease_out_btn" to="." method="_on_ease_out_btn_gui_input"]
[connection signal="value_changed" from="keyframeSettings/curvePanel/curve/ease_in" to="." method="_on_ease_in_value_changed"]
[connection signal="value_changed" from="keyframeSettings/curvePanel/curve/ease_out" to="." method="_on_ease_out_value_changed"]
[connection signal="pressed" from="keyframeSettings/tweening_btn" to="." method="_on_dropdown_pressed"]
[connection signal="pressed" from="keyframeSettings/dropdown" to="." method="_on_dropdown_pressed"]
[connection signal="gui_input" from="AnimationList" to="." method="_on_animation_list_gui_input"]
Expand Down

0 comments on commit 78877b8

Please sign in to comment.