Element styling, rename IsMousePressed to IsMouseButtonPressed in InputSystem, Button widget.
This commit is contained in:
@@ -19,7 +19,7 @@ public class TestGame : Game
|
||||
{
|
||||
InitializeSystemsDefault();
|
||||
|
||||
_uiSystem = new UISystem(Input, ResourceRef<Style>.Empty());
|
||||
_uiSystem = new UISystem(Input, StyleSheet.Default);
|
||||
// _uiSystem.RenderDebugRects = true;
|
||||
|
||||
_particleSystem = new ParticleSystem();
|
||||
@@ -64,7 +64,6 @@ public class TestGame : Game
|
||||
_emitterId = _particleSystem.CreateEmitter(Renderer.WindowSize / 2, _fireEffect);
|
||||
|
||||
var addButton = new Button("Add element", _defaultFontSet, () => { _container.AddChild(new Label("Hello, World!", _defaultFontSet)); });
|
||||
addButton.Padding = new Margin(8.0f);
|
||||
|
||||
var removeButton = new Button("Remove element", _defaultFontSet, () =>
|
||||
{
|
||||
@@ -73,21 +72,30 @@ public class TestGame : Game
|
||||
_container.RemoveChild(lastChild);
|
||||
});
|
||||
|
||||
removeButton.Padding = new Margin(8.0f);
|
||||
removeButton.StyleVariant = "Danger";
|
||||
|
||||
_buttonContainer.AddChild(addButton);
|
||||
_buttonContainer.AddChild(removeButton);
|
||||
// _buttonContainer.AddChild(addButton);
|
||||
// _buttonContainer.AddChild(removeButton);
|
||||
|
||||
var c = new VerticalContainer();
|
||||
var c = new HorizontalContainer()
|
||||
{
|
||||
StyleVariant = "Layer01",
|
||||
ConfineToContents = true,
|
||||
Anchor = Anchor.TopCenter
|
||||
};
|
||||
|
||||
var m = new MarginContainer();
|
||||
m.AddChild(_container);
|
||||
c.AddChild(addButton);
|
||||
c.AddChild(removeButton);
|
||||
|
||||
c.AddChild(_buttonContainer);
|
||||
c.AddChild(m);
|
||||
var vc = new VerticalContainer(0.0f);
|
||||
vc.AddChild(c);
|
||||
|
||||
_rootFill.AddChild(c);
|
||||
var f = new MarginContainer(new Margin(0.0f));
|
||||
f.AddChild(_container);
|
||||
|
||||
vc.AddChild(f);
|
||||
|
||||
_rootFill.AddChild(vc);
|
||||
_uiSystem.AddElement(_rootFill);
|
||||
}
|
||||
|
||||
@@ -152,7 +160,8 @@ public class TestGame : Game
|
||||
Justify = JustifyContent.Start,
|
||||
Align = AlignItems.Center,
|
||||
Wrap = true,
|
||||
Gap = 8.0f
|
||||
Gap = 8.0f,
|
||||
StyleVariant = "Layer02",
|
||||
};
|
||||
|
||||
[NotNull] private Label _label;
|
||||
|
||||
Reference in New Issue
Block a user