فهرست منبع

Update Tween demo to use Containers

Aaron Franke 4 سال پیش
والد
کامیت
6bdbeafca2
6فایلهای تغییر یافته به همراه322 افزوده شده و 286 حذف شده
  1. BIN
      2d/tween/icon.png
  2. 37 30
      2d/tween/main.gd
  3. 284 255
      2d/tween/main.tscn
  4. BIN
      2d/tween/noto_sans_ui_regular.ttf
  5. 1 1
      2d/tween/project.godot
  6. BIN
      2d/tween/screenshots/tween.png

BIN
2d/tween/icon.png


+ 37 - 30
2d/tween/main.gd

@@ -9,17 +9,27 @@ var state = {
 	eases = Tween.EASE_IN,
 }
 
-onready var trans = $Trans
-onready var eases = $Eases
-onready var modes = $Modes
 onready var tween = $Tween
-onready var timeline = $Timeline
-onready var color_from_picker = $Colors/ColorFrom/Picker
-onready var color_to_picker = $Colors/ColorTo/Picker
-onready var sprite = $Tween/Area/Sprite
-onready var follow = $Tween/Area/Follow
-onready var follow_2 = $Tween/Area/Follow2
-onready var size = $Tween/Area.get_size()
+onready var trans = $Controls/Transitions
+onready var eases = $Controls/Eases
+onready var modes = $Controls/Modes
+onready var timeline = $Top/Timeline
+onready var color_from_picker = $Controls/ColorFrom/ColorPicker
+onready var color_to_picker = $Controls/ColorTo/ColorPicker
+onready var area_label = $Top/Area/RichTextLabel
+onready var sprite = $Top/Area/Sprite
+onready var follow = $Top/Area/Follow
+onready var follow_2 = $Top/Area/Follow2
+onready var size = $Top/Area.get_size()
+
+onready var move_mode = modes.get_node(@"Move")
+onready var color_mode = modes.get_node(@"Color")
+onready var scale_mode = modes.get_node(@"Scale")
+onready var rotate_mode = modes.get_node(@"Rotate")
+onready var callback_mode = modes.get_node(@"Callback")
+onready var follow_mode = modes.get_node(@"Follow")
+onready var repeat_mode = modes.get_node(@"Repeat")
+onready var paused_mode = modes.get_node(@"Pause")
 
 func _ready():
 	for index in range(trans_list.size()):
@@ -37,10 +47,9 @@ func _ready():
 	color_to_picker.set_pick_color(Color.cyan)
 	color_to_picker.connect("color_changed", self, "on_color_changed")
 
-	$Trans/Linear.set_pressed(true)
-	$Eases/In.set_pressed(true)
-	$Modes/Move.set_pressed(true)
-	$Modes/Repeat.set_pressed(true)
+	for node in [trans, eases, modes]:
+		node.get_child(1).set_pressed(true)
+	modes.get_node(@"Repeat").set_pressed(true)
 
 	reset_tween()
 
@@ -71,7 +80,7 @@ func on_eases_changed(ease_name, index):
 
 func on_modes_changed(mode_name):
 	if mode_name == "pause":
-		if $Modes/Pause.is_pressed():
+		if paused_mode.is_pressed():
 			tween.stop_all()
 			timeline.set_mouse_filter(Control.MOUSE_FILTER_PASS)
 		else:
@@ -81,7 +90,7 @@ func on_modes_changed(mode_name):
 		reset_tween()
 
 
-func on_color_changed(_color):
+func _on_ColorPicker_color_changed(_color):
 	reset_tween()
 
 
@@ -90,31 +99,31 @@ func reset_tween():
 	tween.reset_all()
 	tween.remove_all()
 
-	if $Modes/Move.is_pressed():
+	if move_mode.is_pressed():
 		tween.interpolate_method(sprite, "set_position", Vector2(0, 0), Vector2(size.x, size.y), 2, state.trans, state.eases)
 		tween.interpolate_property(sprite, "position", Vector2(size.x, size.y), Vector2(0, 0), 2, state.trans, state.eases, 2)
 
-	if $Modes/Color.is_pressed():
+	if color_mode.is_pressed():
 		tween.interpolate_method(sprite, "set_modulate", color_from_picker.get_pick_color(), color_to_picker.get_pick_color(), 2, state.trans, state.eases)
 		tween.interpolate_property(sprite, "modulate", color_to_picker.get_pick_color(), color_from_picker.get_pick_color(), 2, state.trans, state.eases, 2)
 	else:
 		sprite.set_modulate(Color.white)
 
-	if $Modes/Scale.is_pressed():
+	if scale_mode.is_pressed():
 		tween.interpolate_method(sprite, "set_scale", Vector2(0.5, 0.5), Vector2(1.5, 1.5), 2, state.trans, state.eases)
 		tween.interpolate_property(sprite, "scale", Vector2(1.5, 1.5), Vector2(0.5, 0.5), 2, state.trans, state.eases, 2)
 	else:
 		sprite.set_scale(Vector2.ONE)
 
-	if $Modes/Rotate.is_pressed():
+	if rotate_mode.is_pressed():
 		tween.interpolate_method(sprite, "set_rotation_degrees", 0, 360, 2, state.trans, state.eases)
 		tween.interpolate_property(sprite, "rotation_degrees", 360, 0, 2, state.trans, state.eases, 2)
 
-	if $Modes/Callback.is_pressed():
+	if callback_mode.is_pressed():
 		tween.interpolate_callback(self, 0.5, "on_callback", "0.5 seconds after")
 		tween.interpolate_callback(self, 0.2, "on_callback", "1.2 seconds after")
 
-	if $Modes/Follow.is_pressed():
+	if follow_mode.is_pressed():
 		follow.show()
 		follow_2.show()
 
@@ -127,31 +136,29 @@ func reset_tween():
 		follow.hide()
 		follow_2.hide()
 
-	tween.set_repeat($Modes/Repeat.is_pressed())
+	tween.set_repeat(repeat_mode.is_pressed())
 	tween.start()
 	tween.seek(pos)
 
-	if $Modes/Pause.is_pressed():
+	if paused_mode.is_pressed():
 		tween.stop_all()
-		#get_node("timeline").set_ignore_mouse(false)
 		timeline.set_value(0)
 	else:
 		tween.resume_all()
-		#get_node("timeline").set_ignore_mouse(true)
 
 
-func _on_tween_step(_object, _key, elapsed, _value):
+func _on_Tween_tween_step(_object, _key, elapsed, _value):
 	var runtime = tween.get_runtime()
 	var ratio = 100 * (elapsed / runtime)
 	timeline.set_value(ratio)
 
 
-func _on_timeline_value_changed(value):
-	if !$Modes/Pause.is_pressed():
+func _on_Timeline_value_changed(value):
+	if not paused_mode.is_pressed():
 		return
 	var runtime = tween.get_runtime()
 	tween.seek(runtime * value / 100)
 
 
 func on_callback(arg):
-	$Tween/Area/Label.add_text("on_callback -> " + arg + "\n")
+	area_label.add_text("on_callback -> " + arg + "\n")

+ 284 - 255
2d/tween/main.tscn

@@ -1,358 +1,387 @@
-[gd_scene load_steps=3 format=2]
+[gd_scene load_steps=6 format=2]
 
 [ext_resource path="res://main.gd" type="Script" id=1]
 [ext_resource path="res://godot.png" type="Texture" id=2]
+[ext_resource path="res://noto_sans_ui_regular.ttf" type="DynamicFontData" id=3]
 
-[node name="Main" type="Control"]
+[sub_resource type="DynamicFont" id=1]
+font_data = ExtResource( 3 )
+
+[sub_resource type="Theme" id=2]
+default_font = SubResource( 1 )
+
+[node name="Main" type="VBoxContainer"]
+anchor_right = 1.0
+anchor_bottom = 1.0
+theme = SubResource( 2 )
+alignment = 1
+script = ExtResource( 1 )
+__meta__ = {
+"_edit_use_anchors_": false
+}
+
+[node name="Tween" type="Tween" parent="."]
+repeat = true
+playback/repeat = true
+
+[node name="Top" type="VBoxContainer" parent="."]
+margin_left = 112.0
+margin_right = 912.0
+margin_bottom = 230.0
+rect_min_size = Vector2( 800, 230 )
+size_flags_horizontal = 6
+alignment = 2
+
+[node name="Area" type="Panel" parent="Top"]
+margin_top = 18.0
+margin_right = 800.0
+margin_bottom = 178.0
+rect_min_size = Vector2( 800, 160 )
+__meta__ = {
+"_edit_use_anchors_": false
+}
+
+[node name="RichTextLabel" type="RichTextLabel" parent="Top/Area"]
 anchor_left = 0.5
 anchor_top = 0.5
 anchor_right = 0.5
 anchor_bottom = 0.5
-margin_left = -512.0
-margin_top = -384.0
-margin_right = 512.0
-margin_bottom = 384.0
+margin_left = -120.0
+margin_top = -60.0
+margin_right = 120.0
+margin_bottom = 60.0
 size_flags_horizontal = 2
 size_flags_vertical = 2
-script = ExtResource( 1 )
 __meta__ = {
 "_edit_use_anchors_": false
 }
 
-[node name="Trans" type="VBoxContainer" parent="."]
-margin_left = 56.0
-margin_top = 288.0
-margin_right = 129.0
-margin_bottom = 614.0
-size_flags_horizontal = 2
-size_flags_vertical = 2
+[node name="Sprite" type="Sprite" parent="Top/Area"]
+z_index = 1
+texture = ExtResource( 2 )
 
-[node name="Linear" type="Button" parent="Trans"]
-margin_right = 48.0
-margin_bottom = 20.0
-size_flags_horizontal = 2
-size_flags_vertical = 2
-toggle_mode = true
-text = "linear"
+[node name="Follow" type="Sprite" parent="Top/Area"]
+position = Vector2( 0, 160 )
+z_index = 1
+texture = ExtResource( 2 )
 
-[node name="Sine" type="Button" parent="Trans"]
-margin_top = 30.0
-margin_right = 39.0
-margin_bottom = 50.0
-size_flags_horizontal = 2
-size_flags_vertical = 2
-toggle_mode = true
-text = "sine"
+[node name="Follow2" type="Sprite" parent="Top/Area"]
+position = Vector2( 800, 0 )
+z_index = 1
+texture = ExtResource( 2 )
 
-[node name="Quint" type="Button" parent="Trans"]
-margin_top = 60.0
-margin_right = 45.0
-margin_bottom = 80.0
-size_flags_horizontal = 2
-size_flags_vertical = 2
-toggle_mode = true
-text = "quint"
+[node name="Timeline" type="HSlider" parent="Top"]
+margin_top = 182.0
+margin_right = 800.0
+margin_bottom = 230.0
+rect_min_size = Vector2( 0, 48 )
+size_flags_horizontal = 3
+value = 1.0
+ticks_on_borders = true
+__meta__ = {
+"_edit_use_anchors_": false
+}
 
-[node name="Quart" type="Button" parent="Trans"]
-margin_top = 90.0
-margin_right = 45.0
-margin_bottom = 110.0
-size_flags_horizontal = 2
+[node name="Controls" type="HBoxContainer" parent="."]
+margin_top = 234.0
+margin_right = 1024.0
+margin_bottom = 804.0
+rect_min_size = Vector2( 1000, 550 )
+custom_constants/separation = 20
+alignment = 1
+
+[node name="Modes" type="VBoxContainer" parent="Controls"]
+margin_left = 37.0
+margin_right = 110.0
+margin_bottom = 383.0
+rect_min_size = Vector2( 70, 0 )
+size_flags_vertical = 0
+custom_constants/separation = 16
+
+[node name="ModesLabel" type="Label" parent="Controls/Modes"]
+margin_right = 73.0
+margin_bottom = 23.0
+size_flags_horizontal = 3
+text = "Modes"
+align = 1
+
+[node name="Move" type="Button" parent="Controls/Modes"]
+margin_top = 39.0
+margin_right = 73.0
+margin_bottom = 68.0
+size_flags_horizontal = 3
 size_flags_vertical = 2
 toggle_mode = true
-text = "quart"
+text = "move"
 
-[node name="Quad" type="Button" parent="Trans"]
-margin_top = 120.0
-margin_right = 43.0
-margin_bottom = 140.0
-size_flags_horizontal = 2
+[node name="Color" type="Button" parent="Controls/Modes"]
+margin_top = 84.0
+margin_right = 73.0
+margin_bottom = 113.0
+size_flags_horizontal = 3
 size_flags_vertical = 2
 toggle_mode = true
-text = "quad"
+text = "color"
 
-[node name="Expo" type="Button" parent="Trans"]
-margin_top = 150.0
-margin_right = 43.0
-margin_bottom = 170.0
-size_flags_horizontal = 2
+[node name="Scale" type="Button" parent="Controls/Modes"]
+margin_top = 129.0
+margin_right = 73.0
+margin_bottom = 158.0
+size_flags_horizontal = 3
 size_flags_vertical = 2
 toggle_mode = true
-text = "expo"
+text = "scale"
 
-[node name="Elastic" type="Button" parent="Trans"]
-margin_top = 180.0
-margin_right = 54.0
-margin_bottom = 200.0
-size_flags_horizontal = 2
+[node name="Rotate" type="Button" parent="Controls/Modes"]
+margin_top = 174.0
+margin_right = 73.0
+margin_bottom = 203.0
+size_flags_horizontal = 3
 size_flags_vertical = 2
 toggle_mode = true
-text = "elastic"
+text = "rotate"
 
-[node name="Cubic" type="Button" parent="Trans"]
-margin_top = 210.0
-margin_right = 46.0
-margin_bottom = 230.0
-size_flags_horizontal = 2
+[node name="Callback" type="Button" parent="Controls/Modes"]
+margin_top = 219.0
+margin_right = 73.0
+margin_bottom = 248.0
+size_flags_horizontal = 3
 size_flags_vertical = 2
 toggle_mode = true
-text = "cubic"
+text = "callback"
 
-[node name="Circ" type="Button" parent="Trans"]
-margin_top = 240.0
-margin_right = 35.0
-margin_bottom = 260.0
-size_flags_horizontal = 2
+[node name="Follow" type="Button" parent="Controls/Modes"]
+margin_top = 264.0
+margin_right = 73.0
+margin_bottom = 293.0
+size_flags_horizontal = 3
 size_flags_vertical = 2
 toggle_mode = true
-text = "circ"
+text = "follow"
 
-[node name="Bounce" type="Button" parent="Trans"]
-margin_top = 270.0
-margin_right = 59.0
-margin_bottom = 290.0
-size_flags_horizontal = 2
+[node name="Repeat" type="Button" parent="Controls/Modes"]
+margin_top = 309.0
+margin_right = 73.0
+margin_bottom = 338.0
+size_flags_horizontal = 3
 size_flags_vertical = 2
 toggle_mode = true
-text = "bounce"
+text = "repeat"
 
-[node name="Back" type="Button" parent="Trans"]
-margin_top = 300.0
-margin_right = 41.0
-margin_bottom = 320.0
-size_flags_horizontal = 2
+[node name="Pause" type="Button" parent="Controls/Modes"]
+margin_top = 354.0
+margin_right = 73.0
+margin_bottom = 383.0
+size_flags_horizontal = 3
 size_flags_vertical = 2
 toggle_mode = true
-text = "back"
+text = "pause"
 
-[node name="Eases" type="VBoxContainer" parent="."]
-margin_left = 152.0
-margin_top = 288.0
+[node name="Transitions" type="VBoxContainer" parent="Controls"]
+margin_left = 130.0
 margin_right = 215.0
-margin_bottom = 404.0
-size_flags_horizontal = 2
-size_flags_vertical = 2
+margin_bottom = 518.0
+rect_min_size = Vector2( 70, 0 )
+size_flags_vertical = 0
+custom_constants/separation = 16
+__meta__ = {
+"_edit_use_anchors_": false
+}
 
-[node name="In" type="Button" parent="Eases"]
-margin_right = 24.0
-margin_bottom = 20.0
-size_flags_horizontal = 2
+[node name="TransLabel" type="Label" parent="Controls/Transitions"]
+margin_right = 85.0
+margin_bottom = 23.0
+text = "Transitions"
+align = 1
+
+[node name="Linear" type="Button" parent="Controls/Transitions"]
+margin_top = 39.0
+margin_right = 85.0
+margin_bottom = 68.0
 size_flags_vertical = 2
 toggle_mode = true
-text = "in"
+text = "linear"
 
-[node name="Out" type="Button" parent="Eases"]
-margin_top = 30.0
-margin_right = 33.0
-margin_bottom = 50.0
-size_flags_horizontal = 2
+[node name="Sine" type="Button" parent="Controls/Transitions"]
+margin_top = 84.0
+margin_right = 85.0
+margin_bottom = 113.0
 size_flags_vertical = 2
 toggle_mode = true
-text = "out"
+text = "sine"
 
-[node name="InOut" type="Button" parent="Eases"]
-margin_top = 60.0
-margin_right = 51.0
-margin_bottom = 80.0
-size_flags_horizontal = 2
+[node name="Quint" type="Button" parent="Controls/Transitions"]
+margin_top = 129.0
+margin_right = 85.0
+margin_bottom = 158.0
 size_flags_vertical = 2
 toggle_mode = true
-text = "in_out"
+text = "quint"
 
-[node name="OutIn" type="Button" parent="Eases"]
-margin_top = 90.0
-margin_right = 51.0
-margin_bottom = 110.0
-size_flags_horizontal = 2
+[node name="Quart" type="Button" parent="Controls/Transitions"]
+margin_top = 174.0
+margin_right = 85.0
+margin_bottom = 203.0
 size_flags_vertical = 2
 toggle_mode = true
-text = "out_in"
+text = "quart"
 
-[node name="Modes" type="VBoxContainer" parent="."]
-margin_left = 240.0
-margin_top = 288.0
-margin_right = 317.0
-margin_bottom = 524.0
-size_flags_horizontal = 2
+[node name="Quad" type="Button" parent="Controls/Transitions"]
+margin_top = 219.0
+margin_right = 85.0
+margin_bottom = 248.0
 size_flags_vertical = 2
+toggle_mode = true
+text = "quad"
 
-[node name="Move" type="Button" parent="Modes"]
-margin_right = 48.0
-margin_bottom = 20.0
-size_flags_horizontal = 2
+[node name="Expo" type="Button" parent="Controls/Transitions"]
+margin_top = 264.0
+margin_right = 85.0
+margin_bottom = 293.0
 size_flags_vertical = 2
 toggle_mode = true
-text = "move"
+text = "expo"
 
-[node name="Color" type="Button" parent="Modes"]
-margin_top = 30.0
-margin_right = 44.0
-margin_bottom = 50.0
-size_flags_horizontal = 2
+[node name="Elastic" type="Button" parent="Controls/Transitions"]
+margin_top = 309.0
+margin_right = 85.0
+margin_bottom = 338.0
 size_flags_vertical = 2
 toggle_mode = true
-text = "color"
+text = "elastic"
 
-[node name="Scale" type="Button" parent="Modes"]
-margin_top = 60.0
-margin_right = 45.0
-margin_bottom = 80.0
-size_flags_horizontal = 2
+[node name="Cubic" type="Button" parent="Controls/Transitions"]
+margin_top = 354.0
+margin_right = 85.0
+margin_bottom = 383.0
 size_flags_vertical = 2
 toggle_mode = true
-text = "scale"
+text = "cubic"
 
-[node name="Rotate" type="Button" parent="Modes"]
-margin_top = 90.0
-margin_right = 50.0
-margin_bottom = 110.0
-size_flags_horizontal = 2
+[node name="Circ" type="Button" parent="Controls/Transitions"]
+margin_top = 399.0
+margin_right = 85.0
+margin_bottom = 428.0
 size_flags_vertical = 2
 toggle_mode = true
-text = "rotate"
+text = "circ"
 
-[node name="Callback" type="Button" parent="Modes"]
-margin_top = 120.0
-margin_right = 63.0
-margin_bottom = 140.0
-size_flags_horizontal = 2
+[node name="Bounce" type="Button" parent="Controls/Transitions"]
+margin_top = 444.0
+margin_right = 85.0
+margin_bottom = 473.0
 size_flags_vertical = 2
 toggle_mode = true
-text = "callback"
+text = "bounce"
 
-[node name="Follow" type="Button" parent="Modes"]
-margin_top = 150.0
-margin_right = 50.0
-margin_bottom = 170.0
-size_flags_horizontal = 2
+[node name="Back" type="Button" parent="Controls/Transitions"]
+margin_top = 489.0
+margin_right = 85.0
+margin_bottom = 518.0
 size_flags_vertical = 2
 toggle_mode = true
-text = "follow"
+text = "back"
 
-[node name="Repeat" type="Button" parent="Modes"]
-margin_top = 180.0
-margin_right = 53.0
-margin_bottom = 200.0
-size_flags_horizontal = 2
+[node name="Eases" type="VBoxContainer" parent="Controls"]
+margin_left = 235.0
+margin_right = 305.0
+margin_bottom = 203.0
+rect_min_size = Vector2( 70, 0 )
+size_flags_vertical = 0
+custom_constants/separation = 16
+
+[node name="EasesLabel" type="Label" parent="Controls/Eases"]
+margin_right = 70.0
+margin_bottom = 23.0
+size_flags_horizontal = 3
+text = "Eases"
+align = 1
+
+[node name="In" type="Button" parent="Controls/Eases"]
+margin_top = 39.0
+margin_right = 70.0
+margin_bottom = 68.0
+size_flags_horizontal = 3
 size_flags_vertical = 2
 toggle_mode = true
-text = "repeat"
+text = "in"
 
-[node name="Pause" type="Button" parent="Modes"]
-margin_top = 210.0
-margin_right = 50.0
-margin_bottom = 230.0
-size_flags_horizontal = 2
+[node name="Out" type="Button" parent="Controls/Eases"]
+margin_top = 84.0
+margin_right = 70.0
+margin_bottom = 113.0
+size_flags_horizontal = 3
 size_flags_vertical = 2
 toggle_mode = true
-text = "pause"
+text = "out"
 
-[node name="Colors" type="HBoxContainer" parent="."]
-margin_left = 352.0
-margin_top = 273.0
-margin_right = 1008.0
-margin_bottom = 753.0
-size_flags_horizontal = 2
+[node name="InOut" type="Button" parent="Controls/Eases"]
+margin_top = 129.0
+margin_right = 70.0
+margin_bottom = 158.0
+size_flags_horizontal = 3
 size_flags_vertical = 2
-custom_constants/separation = 40
-__meta__ = {
-"_edit_use_anchors_": false
-}
+toggle_mode = true
+text = "in_out"
 
-[node name="ColorFrom" type="VBoxContainer" parent="Colors"]
-margin_right = 308.0
-margin_bottom = 480.0
-rect_min_size = Vector2( 0, 320 )
-size_flags_horizontal = 2
+[node name="OutIn" type="Button" parent="Controls/Eases"]
+margin_top = 174.0
+margin_right = 70.0
+margin_bottom = 203.0
+size_flags_horizontal = 3
 size_flags_vertical = 2
+toggle_mode = true
+text = "out_in"
 
-[node name="Label" type="Label" parent="Colors/ColorFrom"]
-margin_right = 74.0
-margin_bottom = 14.0
+[node name="ColorFrom" type="VBoxContainer" parent="Controls"]
+margin_left = 325.0
+margin_right = 646.0
+margin_bottom = 570.0
+rect_min_size = Vector2( 320, 570 )
+size_flags_vertical = 0
+
+[node name="Label" type="Label" parent="Controls/ColorFrom"]
+margin_right = 89.0
+margin_bottom = 23.0
 size_flags_horizontal = 2
 size_flags_vertical = 0
 text = "Color From:"
 
-[node name="Picker" type="ColorPicker" parent="Colors/ColorFrom"]
-margin_top = 18.0
-margin_right = 308.0
-margin_bottom = 480.0
-rect_min_size = Vector2( 0, 320 )
+[node name="ColorPicker" type="ColorPicker" parent="Controls/ColorFrom"]
+margin_top = 27.0
+margin_right = 321.0
+margin_bottom = 539.0
 size_flags_horizontal = 2
 size_flags_vertical = 2
+__meta__ = {
+"_edit_use_anchors_": false
+}
 
-[node name="ColorTo" type="VBoxContainer" parent="Colors"]
-margin_left = 348.0
-margin_right = 656.0
-margin_bottom = 480.0
-rect_min_size = Vector2( 0, 320 )
-size_flags_horizontal = 2
-size_flags_vertical = 2
+[node name="ColorTo" type="VBoxContainer" parent="Controls"]
+margin_left = 666.0
+margin_right = 987.0
+margin_bottom = 570.0
+rect_min_size = Vector2( 320, 570 )
+rect_clip_content = true
+size_flags_vertical = 0
 
-[node name="Label" type="Label" parent="Colors/ColorTo"]
-margin_right = 56.0
-margin_bottom = 14.0
+[node name="Label" type="Label" parent="Controls/ColorTo"]
+margin_right = 68.0
+margin_bottom = 23.0
 size_flags_horizontal = 2
 size_flags_vertical = 0
 text = "Color To:"
 
-[node name="Picker" type="ColorPicker" parent="Colors/ColorTo"]
-margin_top = 18.0
-margin_right = 308.0
-margin_bottom = 480.0
-rect_min_size = Vector2( 0, 320 )
+[node name="ColorPicker" type="ColorPicker" parent="Controls/ColorTo"]
+margin_top = 27.0
+margin_right = 321.0
+margin_bottom = 539.0
 size_flags_horizontal = 2
 size_flags_vertical = 2
-
-[node name="Tween" type="Tween" parent="."]
-repeat = true
-playback/repeat = true
-
-[node name="Area" type="Panel" parent="Tween"]
-anchor_left = 0.5
-anchor_top = 0.5
-anchor_right = 0.5
-anchor_bottom = 0.5
-margin_left = -420.0
-margin_top = -352.0
-margin_right = 444.0
-margin_bottom = -152.0
-size_flags_horizontal = 2
-size_flags_vertical = 2
-
-[node name="Label" type="RichTextLabel" parent="Tween/Area"]
-margin_left = 176.0
-margin_top = 24.0
-margin_right = 552.0
-margin_bottom = 160.0
-size_flags_horizontal = 2
-size_flags_vertical = 2
-
-[node name="Sprite" type="Sprite" parent="Tween/Area"]
-texture = ExtResource( 2 )
-
-[node name="Follow" type="Sprite" parent="Tween/Area"]
-position = Vector2( 0, 184 )
-texture = ExtResource( 2 )
-
-[node name="Follow2" type="Sprite" parent="Tween/Area"]
-position = Vector2( 736, 0 )
-texture = ExtResource( 2 )
-
-[node name="Timeline" type="HSlider" parent="."]
-anchor_left = 0.5
-anchor_top = 0.5
-anchor_right = 0.5
-anchor_bottom = 0.5
-margin_left = -416.0
-margin_top = -144.0
-margin_right = 416.0
-margin_bottom = -128.0
-size_flags_horizontal = 2
-value = 1.0
-ticks_on_borders = true
 __meta__ = {
 "_edit_use_anchors_": false
 }
-[connection signal="tween_step" from="Tween" to="." method="_on_tween_step"]
-[connection signal="value_changed" from="Timeline" to="." method="_on_timeline_value_changed"]
+[connection signal="tween_step" from="Tween" to="." method="_on_Tween_tween_step"]
+[connection signal="value_changed" from="Top/Timeline" to="." method="_on_Timeline_value_changed"]
+[connection signal="color_changed" from="Controls/ColorFrom/ColorPicker" to="." method="_on_ColorPicker_color_changed"]
+[connection signal="color_changed" from="Controls/ColorTo/ColorPicker" to="." method="_on_ColorPicker_color_changed"]

BIN
2d/tween/noto_sans_ui_regular.ttf


+ 1 - 1
2d/tween/project.godot

@@ -27,7 +27,7 @@ gdscript/warnings/return_value_discarded=false
 
 [display]
 
-window/size/height=768
+window/size/height=800
 window/dpi/allow_hidpi=true
 window/stretch/mode="2d"
 window/stretch/aspect="expand"

BIN
2d/tween/screenshots/tween.png