mlpcardgame/Scenes/Draft/PlayerItem.gd

23 lines
590 B
GDScript3
Raw Permalink Normal View History

2019-06-29 13:02:11 +00:00
extends Panel
export var isBot: bool = false
export var playerName: String = "Nobody"
export var pickedColor: Color
export var pickingColor: Color
onready var playerIcon := $PlayerIcon
onready var playerNameLabel := $PlayerName
func _ready():
if isBot:
var atl := (playerIcon.texture as AtlasTexture).duplicate()
atl.region.position.x = 0
playerIcon.texture = atl
playerNameLabel.text = playerName
func set_picked(picked: bool):
if picked:
playerNameLabel.add_color_override("font_color", pickedColor)
else:
playerNameLabel.add_color_override("font_color", pickingColor)