online multiplayer chess game (note server currently down)
Diffstat (limited to 'ui/menus/sidebarright/material/MaterialLabel.gd')
-rw-r--r--ui/menus/sidebarright/material/MaterialLabel.gd10
1 files changed, 6 insertions, 4 deletions
diff --git a/ui/menus/sidebarright/material/MaterialLabel.gd b/ui/menus/sidebarright/material/MaterialLabel.gd
index 79d0af4..e6ad54c 100644
--- a/ui/menus/sidebarright/material/MaterialLabel.gd
+++ b/ui/menus/sidebarright/material/MaterialLabel.gd
@@ -15,15 +15,17 @@ func _ready():
func display(pieces: Dictionary, score: int) -> void:
get_tree().call_group("material@" + name, "free")
for p in pieces:
+ var container := HBoxContainer.new()
+ container.add_constant_override("separation", -14 if p == "p" else -8)
+ container.add_to_group("material@" + name)
+ container.name = p
for i in pieces[p]:
var t := TextureRect.new()
t.expand = true
t.stretch_mode = t.STRETCH_KEEP_ASPECT
t.rect_min_size = Vector2(30, 30)
t.texture = load("res://assets/silhouette/%s.png" % p.to_upper())
-
- add_child(t)
- t.add_to_group("material@" + name)
- t.name = p
+ container.add_child(t)
+ add_child(container)
move_child(l, get_child_count())
l.text = ("+%d " % score) if score > 0 else ""