bordello/Scripts/bonus_icon.gd

18 lines
330 B
GDScript3
Raw Normal View History

2023-06-06 13:35:20 +10:00
extends Node2D
var service = Data.services.CIRCLE
func get_icon(x):
var y = 0
if x > 9:
y += (x - 9) * 32
else:
y += x * 32
return y
func set_service(_service):
service = _service
2023-06-13 19:21:13 +10:00
$Label.text = "$" + str(Data.service_prices[service])
2023-06-06 13:35:20 +10:00
$Label.visible = true
$"Icon1".region_rect = Rect2(get_icon(service), 0, 32, 32)