Add parsing for Size.

This commit is contained in:
2025-06-29 23:27:16 +02:00
parent 5d3a2c2222
commit c6e1bf7f41
8 changed files with 89 additions and 19 deletions

View File

@@ -1,6 +1,7 @@
[Button]
BackgroundColor = "#0f62fe"
TextColor = "#ffffff"
# Padding = [0.0, 12.0, 8.0, 0.0]
Padding = 16.0
# Creates an empty rule for Button.Normal.
@@ -40,6 +41,24 @@ BackgroundColor = "#0353e9"
BackgroundColor = "#002d9c"
BorderColor = [0, 0, 0, 0]
[Button.Link]
BackgroundColor = [0, 0, 0, 0]
TextColor = "#0f62fe"
Padding = 0.0
[Button.Link.Normal]
[Button.Link.Hovered]
BorderColor = "#0043ce"
TextColor = "#0043ce"
BorderSize = [0, 0, 0, 1]
[Button.Link.Pressed]
TextColor = "#161616"
BorderSize = [0, 0, 0, 1]
BorderColor = "#161616"
# Default background color for all Container derived classes.
[Container]
BackgroundColor = "#e0e0e0"

View File

@@ -22,6 +22,8 @@ public class TestGame : Game
_uiSystem = new UISystem(Input);
// _uiSystem.RenderDebugRects = true;
ResourceManager.EnableFileWatching();
_particleSystem = new ParticleSystem();
AddSystemToUpdate(_uiSystem);
@@ -80,8 +82,9 @@ public class TestGame : Game
var outlineButton = new Button("Outline button", _defaultFontSet);
outlineButton.StyleVariant = "Outline";
_buttonContainer.AddChild(addButton);
_buttonContainer.AddChild(removeButton);
var linkButton = new Button("Link button", _defaultFontSet);
linkButton.StyleVariant = "Link";
var c = new HorizontalContainer()
{
@@ -93,6 +96,7 @@ public class TestGame : Game
c.AddChild(addButton);
c.AddChild(removeButton);
c.AddChild(outlineButton);
c.AddChild(linkButton);
var vc = new VerticalContainer(0.0f);
vc.AddChild(c);