-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Make a scene transition autoload * Make anim and temp script * Make simple script * Add scenetrans to autoload * added it to autoload * Fixed the bug where ui is weird * Added Transition to all * Add it to luar rumah andika juga * Addded trans to intro * IDK FIXED SOME BUGS ???? * idk fixing bugs * Bug fixed
- Loading branch information
1 parent
c4ef3bd
commit 192f487
Showing
18 changed files
with
357 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,20 @@ | ||
extends Node | ||
|
||
|
||
signal changing_scene_started | ||
signal changing_scene_ended | ||
|
||
var from: String # Variabel buat memberitahu ruang sebelumnya | ||
|
||
var is_changing_scene := false | ||
|
||
|
||
func change_scene_with_transition(packed_scene: PackedScene): | ||
if is_changing_scene: | ||
return | ||
|
||
is_changing_scene = true | ||
SceneTransition.start_transition(SceneTransition.FADE_TO_BLACK) | ||
await SceneTransition.transition_in_middle | ||
get_tree().call_deferred("change_scene_to_packed", packed_scene) | ||
is_changing_scene = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
extends CanvasLayer | ||
|
||
|
||
var current_transition | ||
|
||
signal transition_started | ||
signal transition_in_middle | ||
signal transition_ended | ||
|
||
const FADE_TO_BLACK = "FadeToBlack" | ||
|
||
|
||
func start_transition(trans_name: String): | ||
current_transition = find_child(trans_name) | ||
current_transition.begin_animation() | ||
transition_started.emit() | ||
|
||
|
||
func transition_middle(): | ||
transition_in_middle.emit() | ||
await get_tree().create_timer(0.4).timeout | ||
current_transition.end_animation() | ||
|
||
|
||
func end_transition(): | ||
transition_ended.emit() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
[gd_scene load_steps=7 format=3 uid="uid://dm41oxdpp22wt"] | ||
|
||
[ext_resource type="Script" path="res://scenes/autoloads/transition/scene_transition.gd" id="1_ffkmw"] | ||
[ext_resource type="Script" path="res://scenes/autoloads/transition/transition.gd" id="2_vhvhu"] | ||
|
||
[sub_resource type="Animation" id="Animation_lm21w"] | ||
length = 0.001 | ||
tracks/0/type = "value" | ||
tracks/0/imported = false | ||
tracks/0/enabled = true | ||
tracks/0/path = NodePath(".:color") | ||
tracks/0/interp = 1 | ||
tracks/0/loop_wrap = true | ||
tracks/0/keys = { | ||
"times": PackedFloat32Array(0), | ||
"transitions": PackedFloat32Array(1), | ||
"update": 0, | ||
"values": [Color(0, 0, 0, 1)] | ||
} | ||
tracks/1/type = "value" | ||
tracks/1/imported = false | ||
tracks/1/enabled = true | ||
tracks/1/path = NodePath(".:visible") | ||
tracks/1/interp = 1 | ||
tracks/1/loop_wrap = true | ||
tracks/1/keys = { | ||
"times": PackedFloat32Array(0), | ||
"transitions": PackedFloat32Array(1), | ||
"update": 1, | ||
"values": [false] | ||
} | ||
|
||
[sub_resource type="Animation" id="Animation_qce8u"] | ||
resource_name = "begin" | ||
length = 0.4 | ||
tracks/0/type = "value" | ||
tracks/0/imported = false | ||
tracks/0/enabled = true | ||
tracks/0/path = NodePath(".:color") | ||
tracks/0/interp = 1 | ||
tracks/0/loop_wrap = true | ||
tracks/0/keys = { | ||
"times": PackedFloat32Array(0, 0.4), | ||
"transitions": PackedFloat32Array(1, 1), | ||
"update": 0, | ||
"values": [Color(0, 0, 0, 0), Color(0, 0, 0, 1)] | ||
} | ||
tracks/1/type = "value" | ||
tracks/1/imported = false | ||
tracks/1/enabled = true | ||
tracks/1/path = NodePath(".:visible") | ||
tracks/1/interp = 1 | ||
tracks/1/loop_wrap = true | ||
tracks/1/keys = { | ||
"times": PackedFloat32Array(0), | ||
"transitions": PackedFloat32Array(1), | ||
"update": 1, | ||
"values": [true] | ||
} | ||
tracks/2/type = "method" | ||
tracks/2/imported = false | ||
tracks/2/enabled = true | ||
tracks/2/path = NodePath("..") | ||
tracks/2/interp = 1 | ||
tracks/2/loop_wrap = true | ||
tracks/2/keys = { | ||
"times": PackedFloat32Array(0.39), | ||
"transitions": PackedFloat32Array(1), | ||
"values": [{ | ||
"args": [], | ||
"method": &"transition_middle" | ||
}] | ||
} | ||
|
||
[sub_resource type="Animation" id="Animation_dmm2k"] | ||
resource_name = "end" | ||
length = 0.4 | ||
tracks/0/type = "value" | ||
tracks/0/imported = false | ||
tracks/0/enabled = true | ||
tracks/0/path = NodePath(".:color") | ||
tracks/0/interp = 1 | ||
tracks/0/loop_wrap = true | ||
tracks/0/keys = { | ||
"times": PackedFloat32Array(0, 0.4), | ||
"transitions": PackedFloat32Array(1, 1), | ||
"update": 0, | ||
"values": [Color(0, 0, 0, 1), Color(0, 0, 0, 0)] | ||
} | ||
tracks/1/type = "value" | ||
tracks/1/imported = false | ||
tracks/1/enabled = true | ||
tracks/1/path = NodePath(".:visible") | ||
tracks/1/interp = 1 | ||
tracks/1/loop_wrap = true | ||
tracks/1/keys = { | ||
"times": PackedFloat32Array(0, 0.4), | ||
"transitions": PackedFloat32Array(1, 1), | ||
"update": 1, | ||
"values": [true, false] | ||
} | ||
tracks/2/type = "method" | ||
tracks/2/imported = false | ||
tracks/2/enabled = true | ||
tracks/2/path = NodePath("..") | ||
tracks/2/interp = 1 | ||
tracks/2/loop_wrap = true | ||
tracks/2/keys = { | ||
"times": PackedFloat32Array(0.4), | ||
"transitions": PackedFloat32Array(1), | ||
"values": [{ | ||
"args": [], | ||
"method": &"end_transition" | ||
}] | ||
} | ||
|
||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_dqo75"] | ||
_data = { | ||
"RESET": SubResource("Animation_lm21w"), | ||
"begin": SubResource("Animation_qce8u"), | ||
"end": SubResource("Animation_dmm2k") | ||
} | ||
|
||
[node name="SceneTransition" type="CanvasLayer"] | ||
script = ExtResource("1_ffkmw") | ||
metadata/_edit_lock_ = true | ||
|
||
[node name="FadeToBlack" type="ColorRect" parent="."] | ||
visible = false | ||
anchors_preset = 15 | ||
anchor_right = 1.0 | ||
anchor_bottom = 1.0 | ||
grow_horizontal = 2 | ||
grow_vertical = 2 | ||
color = Color(0, 0, 0, 1) | ||
script = ExtResource("2_vhvhu") | ||
|
||
[node name="AnimationPlayer" type="AnimationPlayer" parent="FadeToBlack"] | ||
libraries = { | ||
"": SubResource("AnimationLibrary_dqo75") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
extends ColorRect | ||
|
||
|
||
@onready var animation_player := $AnimationPlayer | ||
|
||
|
||
func begin_animation(): | ||
animation_player.play("begin") | ||
|
||
|
||
func end_animation(): | ||
animation_player.play("end") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.