Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
To Do Break Down
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
breakdown
To Do Break Down
Commits
b884b530
Commit
b884b530
authored
Jan 17, 2022
by
Julia Santos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Started adding text scrolling to dialogue
parent
cba8049c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
60 additions
and
9 deletions
+60
-9
Item.gd
Item.gd
+2
-0
Bathroom.tscn
Main rooms/Bathroom.tscn
+2
-4
Multi.tscn
Multi.tscn
+26
-5
Clothes trail.gd
Scripts/Clothes trail.gd
+1
-0
Text Animator.gd
Scripts/Text Animator.gd
+29
-0
No files found.
Item.gd
View file @
b884b530
...
...
@@ -81,9 +81,11 @@ func storeInt(selected): # specifically for using one item on another, stores mo
# override the following functions as needed when extending the script:
func mouseInteraction(): # just clicked on it with nothing
dialogueBox.text = flavorText
dialogueBox.playText()
func pickup(): # when it's picked up
dialogueBox.text = flavorText
dialogueBox.playText()
inventory.add_item(self.get_name(), texture)
queue_free()
inventory.unselect_all()
...
...
Main rooms/Bathroom.tscn
View file @
b884b530
...
...
@@ -259,13 +259,11 @@ retrievable = true
flavorText = "Good for holding my hair up or picking into small spaces."
[node name="Hitbox" type="CollisionShape2D" parent="Bobby pins"]
visible = false
position = Vector2( 6.81549, -18.2035 )
shape = SubResource( 8 )
disabled = true
[node name="Sprite" type="Sprite" parent="Bobby pins"]
position = Vector2(
62.0674, 20.4902
)
[node name="Sprite" type="Sprite" parent="Bobby pins
/Hitbox
"]
position = Vector2(
55.2519, 38.6937
)
scale = Vector2( 0.03, 0.03 )
texture = ExtResource( 15 )
...
...
Multi.tscn
View file @
b884b530
[gd_scene load_steps=4
1
format=2]
[gd_scene load_steps=4
3
format=2]
[ext_resource path="res://Main rooms/Test room 1.tscn" type="PackedScene" id=1]
[ext_resource path="res://assets/Thesis Clickables/moxie1.png" type="Texture" id=2]
...
...
@@ -34,6 +34,7 @@
[ext_resource path="res://Main rooms/Living room - Notepad.tscn" type="PackedScene" id=32]
[ext_resource path="res://Cutscenes/Cutscene 3.tscn" type="PackedScene" id=33]
[ext_resource path="res://assets/Thesis Clickables/to do list.png" type="Texture" id=34]
[ext_resource path="res://Scripts/Text Animator.gd" type="Script" id=35]
[sub_resource type="Animation" id=1]
resource_name = "Notepad open"
...
...
@@ -59,10 +60,25 @@ bg_color = Color( 0.984314, 0.847059, 0.435294, 1 )
[sub_resource type="RectangleShape2D" id=4]
extents = Vector2( 143.453, 196.701 )
[sub_resource type="StyleBoxFlat" id=5]
bg_color = Color( 0.466667, 0.631373, 0.168627, 1 )
[sub_resource type="Animation" id=5]
resource_name = "Dialogue"
tracks/0/type = "value"
tracks/0/path = NodePath("RichTextLabel:percent_visible")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 0,
"values": [ 0.0 ]
}
[sub_resource type="StyleBoxFlat" id=6]
bg_color = Color( 0.466667, 0.631373, 0.168627, 1 )
[sub_resource type="StyleBoxFlat" id=7]
bg_color = Color( 0.145098, 0.145098, 0.164706, 1 )
[node name="Node2D" type="Node2D"]
...
...
@@ -346,23 +362,28 @@ __meta__ = {
"_edit_use_anchors_": false
}
[node name="Text Animator" type="AnimationPlayer" parent="UI/Dialogue Box"]
anims/Dialogue = SubResource( 5 )
[node name="RichTextLabel" type="RichTextLabel" parent="UI/Dialogue Box"]
margin_left = 21.0
margin_top = 20.0
margin_right = 518.0
margin_bottom = 74.0
scroll_active = false
script = ExtResource( 35 )
__meta__ = {
"_edit_use_anchors_": false
}
textSpeed = "Medium"
[node name="Energy bar" type="ProgressBar" parent="UI"]
margin_left = -197.122
margin_top = -367.765
margin_right = 235.878
margin_bottom = -325.765
custom_styles/fg = SubResource(
5
)
custom_styles/bg = SubResource(
6
)
custom_styles/fg = SubResource(
6
)
custom_styles/bg = SubResource(
7
)
value = 50.0
percent_visible = false
__meta__ = {
...
...
Scripts/Clothes trail.gd
View file @
b884b530
...
...
@@ -16,6 +16,7 @@ func pickup():
if (eventHandler.get_clothes() == 0):
inventory.add_item("Dirty clothes", load("res://.import/clothes pile.png-0e9642e1068a37424f7c246204716908.stex"))
dialogueBox.text = flavorText
dialogueBox.playText()
queue_free()
inventory.unselect_all()
emit_signal("retrieved")
Scripts/Text Animator.gd
0 → 100644
View file @
b884b530
extends RichTextLabel
onready var textLength = 0
onready var animationPlayer = get_parent().get_node("Text Animator")
onready var textAnimation = animationPlayer.get_animation("Dialogue")
export(String, "Slow", "Medium", "Fast") var textSpeed
# Called when the node enters the scene tree for the first time.
func _ready():
pass
func playText():
animationPlayer.stop()
textLength = text.length()
if textAnimation.track_get_key_count(0) == 2:
textAnimation.track_remove_key(0,1)
textAnimation.length = float(textLength)/float(checkSpeed(textSpeed))
textAnimation.track_insert_key(0, textAnimation.length, 1)
print("text: " + str(textLength) + ", animation length: " + str(textAnimation.length))
animationPlayer.play("Dialogue")
func checkSpeed(spd):
match spd:
"Slow":
return 80
"Medium":
return 100
"Fast":
return 150
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment