forked from team-sg/hero-mark-2
make hud music text dynamic
This commit is contained in:
parent
da6a97cb70
commit
caff76a99d
2 changed files with 18 additions and 29 deletions
|
@ -13,7 +13,7 @@ onready var lives_counter = $LivesCounter
|
||||||
onready var high_counter = $HighCounter
|
onready var high_counter = $HighCounter
|
||||||
onready var time_counter = $TimeCounter
|
onready var time_counter = $TimeCounter
|
||||||
|
|
||||||
export var song_name = "@Rumble"
|
export var song_name = "♫Music"
|
||||||
export (Color) var bonus_color
|
export (Color) var bonus_color
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
|
@ -24,7 +24,13 @@ func _ready():
|
||||||
else:
|
else:
|
||||||
$DeathsHead.visible = true
|
$DeathsHead.visible = true
|
||||||
#Change text to song name
|
#Change text to song name
|
||||||
$Music.text = song_name
|
var music = $Music
|
||||||
|
music.text = song_name
|
||||||
|
yield(get_tree(), "idle_frame")
|
||||||
|
var tween = create_tween()
|
||||||
|
tween.tween_property(music, "rect_position:x", 254.0 - music.rect_size.x, 1.0)
|
||||||
|
tween.tween_interval(3.0)
|
||||||
|
tween.tween_property(music, "rect_position:x", 256.0, 1.0)
|
||||||
|
|
||||||
func _physics_process(delta):
|
func _physics_process(delta):
|
||||||
#Gold Counter
|
#Gold Counter
|
||||||
|
|
|
@ -8,32 +8,17 @@
|
||||||
[ext_resource path="res://objects/hud/hud.gd" type="Script" id=6]
|
[ext_resource path="res://objects/hud/hud.gd" type="Script" id=6]
|
||||||
[ext_resource path="res://graphics/hud/key_counter.png" type="Texture" id=7]
|
[ext_resource path="res://graphics/hud/key_counter.png" type="Texture" id=7]
|
||||||
[ext_resource path="res://ui/2ndpuberty_outline.tres" type="Material" id=8]
|
[ext_resource path="res://ui/2ndpuberty_outline.tres" type="Material" id=8]
|
||||||
|
[ext_resource path="res://ui/2ndpuberty_no_dropshadow.tres" type="Theme" id=9]
|
||||||
[ext_resource path="res://ui/theme.tres" type="Theme" id=10]
|
[ext_resource path="res://ui/theme.tres" type="Theme" id=10]
|
||||||
|
|
||||||
[sub_resource type="ShaderMaterial" id=1]
|
[sub_resource type="ShaderMaterial" id=1]
|
||||||
|
|
||||||
[sub_resource type="ShaderMaterial" id=2]
|
[sub_resource type="ShaderMaterial" id=2]
|
||||||
|
|
||||||
[sub_resource type="Animation" id=3]
|
|
||||||
resource_name = "show song name"
|
|
||||||
length = 5.0
|
|
||||||
tracks/0/type = "value"
|
|
||||||
tracks/0/path = NodePath("Music:rect_position")
|
|
||||||
tracks/0/interp = 1
|
|
||||||
tracks/0/loop_wrap = true
|
|
||||||
tracks/0/imported = false
|
|
||||||
tracks/0/enabled = true
|
|
||||||
tracks/0/keys = {
|
|
||||||
"times": PoolRealArray( 0, 0.8, 4.2, 5 ),
|
|
||||||
"transitions": PoolRealArray( 1, 1, 1, 1 ),
|
|
||||||
"update": 0,
|
|
||||||
"values": [ Vector2( 150, 178 ), Vector2( 57, 178 ), Vector2( 57, 178 ), Vector2( 150, 178 ) ]
|
|
||||||
}
|
|
||||||
|
|
||||||
[node name="HUD" type="CanvasLayer"]
|
[node name="HUD" type="CanvasLayer"]
|
||||||
layer = 100
|
layer = 100
|
||||||
script = ExtResource( 6 )
|
script = ExtResource( 6 )
|
||||||
song_name = "♫Rumble"
|
song_name = "♫Music"
|
||||||
bonus_color = Color( 0.478431, 1, 0.47451, 1 )
|
bonus_color = Color( 0.478431, 1, 0.47451, 1 )
|
||||||
|
|
||||||
[node name="Back" type="Sprite" parent="."]
|
[node name="Back" type="Sprite" parent="."]
|
||||||
|
@ -165,14 +150,12 @@ text = "0:00:00"
|
||||||
|
|
||||||
[node name="Music" type="Label" parent="."]
|
[node name="Music" type="Label" parent="."]
|
||||||
material = ExtResource( 8 )
|
material = ExtResource( 8 )
|
||||||
margin_left = 150.0
|
anchor_left = 1.0
|
||||||
margin_top = 180.0
|
anchor_top = 1.0
|
||||||
margin_right = 348.0
|
anchor_right = 1.0
|
||||||
margin_bottom = 190.0
|
anchor_bottom = 1.0
|
||||||
theme = ExtResource( 10 )
|
margin_top = -10.0
|
||||||
text = "♫rumble"
|
margin_right = 42.0
|
||||||
|
theme = ExtResource( 9 )
|
||||||
|
text = "♫Music"
|
||||||
align = 2
|
align = 2
|
||||||
|
|
||||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
|
||||||
autoplay = "show song name"
|
|
||||||
"anims/show song name" = SubResource( 3 )
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue