From 90f80eae757c6232b92561b63fee76ce202f374f Mon Sep 17 00:00:00 2001 From: Jonas Bernard Date: Sun, 25 Apr 2021 00:03:03 +0200 Subject: introduction --- scenes/introduction.gd | 11 +++++++++++ scenes/introduction.tscn | 13 +++++++++++++ scenes/menu.gd | 9 +++++++++ scenes/menu.tscn | 7 +++++-- 4 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 scenes/introduction.gd create mode 100644 scenes/introduction.tscn create mode 100644 scenes/menu.gd (limited to 'scenes') diff --git a/scenes/introduction.gd b/scenes/introduction.gd new file mode 100644 index 0000000..09692b0 --- /dev/null +++ b/scenes/introduction.gd @@ -0,0 +1,11 @@ +extends CanvasLayer + +onready var textreveal = $Textreveal + +# Called when the node enters the scene tree for the first time. +func _ready(): + textreveal.start() + + +func _on_Textreveal_finished_reveal(): + pass diff --git a/scenes/introduction.tscn b/scenes/introduction.tscn new file mode 100644 index 0000000..42a4bfc --- /dev/null +++ b/scenes/introduction.tscn @@ -0,0 +1,13 @@ +[gd_scene load_steps=3 format=2] + +[ext_resource path="res://components/textreveal.tscn" type="PackedScene" id=1] +[ext_resource path="res://scenes/introduction.gd" type="Script" id=2] + +[node name="CanvasLayer" type="CanvasLayer"] +script = ExtResource( 2 ) + +[node name="Textreveal" parent="." instance=ExtResource( 1 )] +position = Vector2( 653.942, 242.431 ) +text = "Long long time ago" +speed = 10.0 +[connection signal="finished_reveal" from="Textreveal" to="." method="_on_Textreveal_finished_reveal"] diff --git a/scenes/menu.gd b/scenes/menu.gd new file mode 100644 index 0000000..c0c6f6b --- /dev/null +++ b/scenes/menu.gd @@ -0,0 +1,9 @@ +extends Node2D + + +func _ready(): + pass + + +func _on_Exit_on_click(): + get_tree().quit() diff --git a/scenes/menu.tscn b/scenes/menu.tscn index adb7754..0a69c87 100644 --- a/scenes/menu.tscn +++ b/scenes/menu.tscn @@ -1,11 +1,13 @@ -[gd_scene load_steps=5 format=2] +[gd_scene load_steps=6 format=2] [ext_resource path="res://components/Logo.tscn" type="PackedScene" id=1] [ext_resource path="res://components/button.tscn" type="PackedScene" id=2] [ext_resource path="res://textures/backgrounds/background_grey.png" type="Texture" id=3] -[ext_resource path="res://textures/backgrounds/background_black.png" type="Texture" id=4] +[ext_resource path="res://textures/backgrounds/background_blue.png" type="Texture" id=4] +[ext_resource path="res://scenes/menu.gd" type="Script" id=5] [node name="Node2D" type="Node2D"] +script = ExtResource( 5 ) [node name="Sprite" type="Sprite" parent="."] position = Vector2( 640, 360 ) @@ -30,3 +32,4 @@ fixed_width = 150 [node name="Logo" parent="." instance=ExtResource( 1 )] position = Vector2( 640, 250 ) rotation = -1.74846e-07 +[connection signal="on_click" from="Exit" to="." method="_on_Exit_on_click"] -- cgit