29 lines
481 B
GDScript
29 lines
481 B
GDScript
extends Control
|
|
|
|
var text
|
|
var module_type = Button
|
|
var value = 0
|
|
|
|
|
|
func init():
|
|
set_stat_text()
|
|
set_value()
|
|
resize()
|
|
|
|
|
|
func resize():
|
|
if %vbox.size.x != $".".size.x:
|
|
%vbox.size.x = $".".size.x
|
|
var sizey = 0
|
|
for i in %vbox.get_children():
|
|
sizey = sizey + i.size.y
|
|
#print(str(sizey))
|
|
$".".custom_minimum_size.y = sizey + 16
|
|
|
|
func set_stat_text():
|
|
%stat.text = text
|
|
|
|
func set_value():
|
|
var module = module_type.new()
|
|
module.text = str(value)
|
|
%value.add_child(module)
|