basic setup

This commit is contained in:
Clevertop 2024-09-24 10:34:17 +10:00
parent 57c4b27db5
commit 8653ab0d2b
11 changed files with 305 additions and 15 deletions

62
tools/Presentation.gd Normal file
View file

@ -0,0 +1,62 @@
extends Node
#class_name
#Authored by Tom. Please consult for any modifications or major feature requests.
#region Variables
#Signals
#Enums
#Constants
#Exported Variables
#@export_group("Group")
#@export_subgroup("Subgroup")
@export var slides_node : Control
#Onready Variables
#Other Variables (please try to separate and organise!)
var slides : Array[Node]
var current_slide : int = 0
var total_slides : int
#endregion
#region Godot methods
func _ready():
slides = slides_node.get_children()
total_slides = slides_node.get_child_count()
for slide in slides:
slide.hide()
slides[current_slide].show()
pass
func _process(delta):
if(Input.is_action_just_pressed("next")):
if current_slide < total_slides-1:
show_next_slide()
elif(Input.is_action_just_pressed("previous")):
if current_slide > 0:
show_previous_slide()
#endregion
#region Signal methods
#endregion
#region Other methods (please try to separate and organise!)
func show_next_slide():
slides[current_slide].hide()
current_slide += 1
slides[current_slide].show()
func show_previous_slide():
slides[current_slide].hide()
current_slide -= 1
slides[current_slide].show()
#endregion

8
tools/base_slide.tscn Normal file
View file

@ -0,0 +1,8 @@
[gd_scene format=3 uid="uid://xxqqqjgt1vmc"]
[node name="BaseSlide" type="VBoxContainer"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2

37
tools/presentation.tscn Normal file
View file

@ -0,0 +1,37 @@
[gd_scene load_steps=5 format=3 uid="uid://c7f5wae7pdjt2"]
[ext_resource type="Script" path="res://tools/Presentation.gd" id="1_qta7b"]
[ext_resource type="PackedScene" uid="uid://xxqqqjgt1vmc" path="res://tools/base_slide.tscn" id="2_aqnf4"]
[sub_resource type="Gradient" id="Gradient_7sx77"]
colors = PackedColorArray(0.15482, 0.358303, 0.295465, 1, 0, 0.391486, 0.564688, 1)
[sub_resource type="GradientTexture2D" id="GradientTexture2D_dod57"]
gradient = SubResource("Gradient_7sx77")
fill_from = Vector2(0, 1)
[node name="Presentation" type="Node" node_paths=PackedStringArray("slides_node")]
script = ExtResource("1_qta7b")
slides_node = NodePath("Slides")
[node name="PresentationBackground" type="TextureRect" parent="."]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
texture = SubResource("GradientTexture2D_dod57")
[node name="Slides" type="Control" parent="."]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="BaseSlide" parent="Slides" instance=ExtResource("2_aqnf4")]
layout_mode = 0
anchors_preset = 0