28 lines
813 B
GDScript
28 lines
813 B
GDScript
extends HFlowContainer
|
|
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
func _ready() -> void:
|
|
pass # Replace with function body.
|
|
|
|
|
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
func _process(delta: float) -> void:
|
|
pass
|
|
|
|
func addFinishedPlayer(playerid,finalTime,playercount):
|
|
print("Finished "+str(playerid)+" final time="+str(finalTime))
|
|
var place=get_child_count()+1
|
|
|
|
var newlabel= Label.new()
|
|
add_child(newlabel)
|
|
#newlabel.set("theme_override_font_sizes/font_size",40)
|
|
newlabel.text=""
|
|
if playercount>1: #singleplayer
|
|
newlabel.text+=str(place)+": "
|
|
newlabel.text+=str(round(finalTime*1000)/1000.0)+"s"
|
|
newlabel.set("theme_override_colors/font_color",Gamestate.getPlayers()[playerid].color)
|
|
|
|
func getPlayersFinished():
|
|
return get_child_count()
|
|
|