29 lines
834 B
GDScript
29 lines
834 B
GDScript
class_name CreditTemplate extends Control
|
|
|
|
@onready var title = $Title
|
|
@onready var nam = $Name
|
|
@onready var description = $Name/Description
|
|
|
|
@export var speed: float = 30
|
|
@export var expireTime: float = 20
|
|
@export var creditInfo: Credit
|
|
|
|
var timer: float = 0
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
func _ready():
|
|
title.text = "[center]%s" % creditInfo.title
|
|
nam.text = "[center]%s" % creditInfo.name
|
|
var paragraph: String = "[center]"
|
|
for desc: String in creditInfo.description:
|
|
paragraph += desc + "\n"
|
|
for link: String in creditInfo.links:
|
|
paragraph += "[url]%s[/url]" % link
|
|
description.text = paragraph
|
|
|
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
func _process(delta):
|
|
timer += delta
|
|
position.y -= speed * delta
|
|
if (timer >= expireTime): self.queue_free()
|