Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Flossy Gnu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Purism
Flossy Gnu
Commits
eb690c9e
Commit
eb690c9e
authored
Mar 15, 2019
by
Nathan Lovato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add high score board UI
parent
13228a34
Pipeline
#5060
passed with stage
in 4 minutes and 24 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
184 additions
and
0 deletions
+184
-0
game/ScoreBoard/ScoreBoard.gd
game/ScoreBoard/ScoreBoard.gd
+16
-0
game/ScoreBoard/ScoreBoard.tscn
game/ScoreBoard/ScoreBoard.tscn
+46
-0
game/ScoreBoard/ScoreRow.gd
game/ScoreBoard/ScoreRow.gd
+24
-0
game/ScoreBoard/ScoreRow.tscn
game/ScoreBoard/ScoreRow.tscn
+80
-0
game/assets/fonts/ScoreRow.tres
game/assets/fonts/ScoreRow.tres
+9
-0
game/assets/fonts/ScoreTitle.tres
game/assets/fonts/ScoreTitle.tres
+9
-0
No files found.
game/ScoreBoard/ScoreBoard.gd
0 → 100644
View file @
eb690c9e
extends
Control
onready
var
scores_column
=
$
Column
/
ScoresColumn
const
score_row
=
preload
(
"res://ScoreBoard/ScoreRow.tscn"
)
func
start
():
for
i
in
range
(
10
):
var
score_instance
=
score_row
.
instance
()
scores_column
.
add_child
(
score_instance
)
score_instance
.
setup
(
i
)
score_instance
.
start
()
func
_ready
()
->
void
:
start
()
game/ScoreBoard/ScoreBoard.tscn
0 → 100644
View file @
eb690c9e
[gd_scene load_steps=4 format=2]
[ext_resource path="res://ScoreBoard/ScoreBoard.gd" type="Script" id=1]
[ext_resource path="res://assets/fonts/ScoreTitle.tres" type="DynamicFont" id=2]
[ext_resource path="res://ScoreBoard/ScoreRow.tscn" type="PackedScene" id=3]
[node name="ScoreBoard" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
script = ExtResource( 1 )
[node name="Column" type="VBoxContainer" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 120.0
margin_top = 400.0
margin_right = -120.0
margin_bottom = -340.0
[node name="Title" type="Label" parent="Column"]
margin_right = 840.0
margin_bottom = 112.0
custom_fonts/font = ExtResource( 2 )
text = "High scores"
align = 1
uppercase = true
[node name="HSeparator" type="HSeparator" parent="Column"]
margin_top = 116.0
margin_right = 840.0
margin_bottom = 120.0
[node name="ScoresColumn" type="VBoxContainer" parent="Column"]
margin_top = 124.0
margin_right = 840.0
margin_bottom = 1180.0
size_flags_vertical = 3
[node name="ScoreRow" parent="Column/ScoresColumn" instance=ExtResource( 3 )]
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 0.0
margin_right = 840.0
margin_bottom = 88.0
game/ScoreBoard/ScoreRow.gd
0 → 100644
View file @
eb690c9e
extends
Control
onready
var
rank_label
:
=
$
Rank
onready
var
score_label
:
=
$
Score
onready
var
initials_label
:
=
$
Initials
onready
var
animation_player
:
=
$
AnimationPlayer
const
COLOR_TRANSPARENT
=
Color
(
'
00ffffff'
)
const
COLOR_OPAQUE
=
Color
(
'
00ffffff'
)
func
setup
(
index
:
int
,
score
:
int
=
1
,
initials
:
String
=
"rms"
)
->
void
:
rank_label
.
set_rank
(
index
)
score_label
.
text
=
"
%03d
"
%
score
initials_label
.
text
=
initials
func
start
()
->
void
:
"""Plays a fade-in animation"""
animation_player
.
play
(
"fade_in"
)
func
_ready
()
->
void
:
modulate
=
COLOR_TRANSPARENT
game/ScoreBoard/ScoreRow.tscn
0 → 100644
View file @
eb690c9e
[gd_scene load_steps=5 format=2]
[ext_resource path="res://ScoreBoard/ScoreRow.gd" type="Script" id=1]
[ext_resource path="res://assets/fonts/ScoreRow.tres" type="DynamicFont" id=2]
[sub_resource type="GDScript" id=1]
script/source = "extends Label
func set_rank(index:int) -> void:
var suffix := \"\"
match index:
0:
suffix = \"st\"
1:
suffix = \"nd\"
2:
suffix = \"rd\"
_:
suffix = \"th\"
text = \"%s%s\" % [index + 1, suffix]
"
[sub_resource type="Animation" id=2]
resource_name = "fade_in"
length = 0.4
tracks/0/type = "value"
tracks/0/path = NodePath(".:modulate")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.4 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ Color( 1, 1, 1, 0 ), Color( 1, 1, 1, 1 ) ]
}
[node name="ScoreRow" type="HBoxContainer"]
anchor_top = 0.5
anchor_right = 1.0
anchor_bottom = 0.5
margin_top = -44.0
margin_bottom = 44.0
alignment = 1
script = ExtResource( 1 )
[node name="Rank" type="Label" parent="."]
margin_right = 357.0
margin_bottom = 88.0
size_flags_horizontal = 3
custom_fonts/font = ExtResource( 2 )
text = "1ST"
uppercase = true
script = SubResource( 1 )
[node name="Score" type="Label" parent="."]
margin_left = 361.0
margin_right = 718.0
margin_bottom = 88.0
size_flags_horizontal = 3
custom_fonts/font = ExtResource( 2 )
text = "001"
align = 1
uppercase = true
[node name="Initials" type="Label" parent="."]
margin_left = 722.0
margin_right = 1080.0
margin_bottom = 88.0
size_flags_horizontal = 3
custom_fonts/font = ExtResource( 2 )
text = "RMS"
align = 2
uppercase = true
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
anims/fade_in = SubResource( 2 )
game/assets/fonts/ScoreRow.tres
0 → 100644
View file @
eb690c9e
[gd_resource type="DynamicFont" load_steps=2 format=2]
[ext_resource path="res://assets/fonts/Cabin-SemiBold.otf" type="DynamicFontData" id=1]
[resource]
size = 72
use_filter = true
font_data = ExtResource( 1 )
game/assets/fonts/ScoreTitle.tres
0 → 100644
View file @
eb690c9e
[gd_resource type="DynamicFont" load_steps=2 format=2]
[ext_resource path="res://assets/fonts/Cabin-SemiBold.otf" type="DynamicFontData" id=1]
[resource]
size = 92
use_filter = true
font_data = ExtResource( 1 )
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