hyper space
This commit is contained in:
20
score_counter/score_counter.gd
Normal file
20
score_counter/score_counter.gd
Normal file
@ -0,0 +1,20 @@
|
||||
extends HBoxContainer
|
||||
|
||||
var digit_coords = {
|
||||
1: Vector2(0, 0),
|
||||
2: Vector2(8, 0),
|
||||
3: Vector2(16, 0),
|
||||
4: Vector2(24, 0),
|
||||
5: Vector2(32, 0),
|
||||
6: Vector2(0, 8),
|
||||
7: Vector2(8, 8),
|
||||
8: Vector2(16, 8),
|
||||
9: Vector2(24, 8),
|
||||
0: Vector2(32, 8)
|
||||
}
|
||||
|
||||
func display_digits(n):
|
||||
var s = "%08d" % n
|
||||
for i in 8:
|
||||
get_child(i).texture.region = Rect2(digit_coords[int(s[i])],
|
||||
Vector2(8, 8))
|
103
score_counter/score_counter.tscn
Normal file
103
score_counter/score_counter.tscn
Normal file
@ -0,0 +1,103 @@
|
||||
[gd_scene load_steps=13 format=3 uid="uid://csdfxrgu1qmd5"]
|
||||
|
||||
[ext_resource type="Script" path="res://score_counter/score_counter.gd" id="1_8d4cn"]
|
||||
[ext_resource type="Texture2D" uid="uid://dq5w04k1dvsx7" path="res://assets/UI objects/Number_font (8 x 8).png" id="1_yrwju"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_jhns6"]
|
||||
atlas = ExtResource("1_yrwju")
|
||||
region = Rect2(32, 8, 8, 8)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_o00fo"]
|
||||
atlas = ExtResource("1_yrwju")
|
||||
region = Rect2(32, 8, 8, 8)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_55rno"]
|
||||
atlas = ExtResource("1_yrwju")
|
||||
region = Rect2(32, 8, 8, 8)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_7rjkr"]
|
||||
atlas = ExtResource("1_yrwju")
|
||||
region = Rect2(32, 8, 8, 8)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_f671c"]
|
||||
atlas = ExtResource("1_yrwju")
|
||||
region = Rect2(32, 8, 8, 8)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_e6aeh"]
|
||||
atlas = ExtResource("1_yrwju")
|
||||
region = Rect2(32, 8, 8, 8)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_5vge4"]
|
||||
atlas = ExtResource("1_yrwju")
|
||||
region = Rect2(32, 8, 8, 8)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_pl1ts"]
|
||||
atlas = ExtResource("1_yrwju")
|
||||
region = Rect2(32, 8, 8, 8)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_8l445"]
|
||||
atlas = ExtResource("1_yrwju")
|
||||
region = Rect2(32, 8, 8, 8)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_xkrqf"]
|
||||
atlas = ExtResource("1_yrwju")
|
||||
region = Rect2(32, 8, 8, 8)
|
||||
|
||||
[node name="ScoreCounter" type="HBoxContainer"]
|
||||
anchors_preset = 10
|
||||
anchor_right = 1.0
|
||||
offset_bottom = 8.0
|
||||
grow_horizontal = 2
|
||||
size_flags_horizontal = 8
|
||||
theme_override_constants/separation = 0
|
||||
script = ExtResource("1_8d4cn")
|
||||
|
||||
[node name="Digit0" type="TextureRect" parent="."]
|
||||
layout_mode = 2
|
||||
texture = SubResource("AtlasTexture_jhns6")
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="Digit1" type="TextureRect" parent="."]
|
||||
layout_mode = 2
|
||||
texture = SubResource("AtlasTexture_o00fo")
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="Digit2" type="TextureRect" parent="."]
|
||||
layout_mode = 2
|
||||
texture = SubResource("AtlasTexture_55rno")
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="Digit3" type="TextureRect" parent="."]
|
||||
layout_mode = 2
|
||||
texture = SubResource("AtlasTexture_7rjkr")
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="Digit4" type="TextureRect" parent="."]
|
||||
layout_mode = 2
|
||||
texture = SubResource("AtlasTexture_f671c")
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="Digit5" type="TextureRect" parent="."]
|
||||
layout_mode = 2
|
||||
texture = SubResource("AtlasTexture_e6aeh")
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="Digit6" type="TextureRect" parent="."]
|
||||
layout_mode = 2
|
||||
texture = SubResource("AtlasTexture_5vge4")
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="Digit7" type="TextureRect" parent="."]
|
||||
layout_mode = 2
|
||||
texture = SubResource("AtlasTexture_pl1ts")
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="Digit8" type="TextureRect" parent="."]
|
||||
layout_mode = 2
|
||||
texture = SubResource("AtlasTexture_8l445")
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="Digit9" type="TextureRect" parent="."]
|
||||
layout_mode = 2
|
||||
texture = SubResource("AtlasTexture_xkrqf")
|
||||
stretch_mode = 5
|
Reference in New Issue
Block a user