Nimble Tools utilities for the Foster game framework.
- C# 100%
| Foster @e6d0fe7671 | Updated Foster and Nimble.Layout | |
| Nimble.Foster | Updated Foster and Nimble.Layout | |
| Nimble.Foster.GUI | Updated Foster and Nimble.Layout | |
| Nimble.Foster.LDtk | Updated Foster and Nimble.Layout | |
| Nimble.Layout @6e1d76f38b | Updated Foster and Nimble.Layout | |
| .gitignore | Initial commit | |
| .gitmodules | Remove Nimble.React ( fixes #1 ) | |
| License.txt | Added license | |
| Nimble.Foster.sln | Removed Boil for now ( fixes #2 ) | |
| Readme.md | Updated Readme | |
Nimble.Foster
Libraries for the Foster game framework.
Installation
Nimble.Foster not on NuGet yet, but I plan to put it there soon. For now, you'll have to add the necessary projects as manual references in your project. This can be done using Git Submodules, for example.
GUI
The GUI library is going to get updated quite a bit over time. There's a lack of documentation right now, but here's an example GUI.xml:
<GUI>
<Template>
<Box Width="500" P9="Frame.png">
<Vbox Behave="Fill" Margin="10" Spacing="10">
<Text>Nimble.Foster.GUI</Text>
<Text Behave="Center">Nimble.Foster.GUI</Text>
<Text Behave="Right">Nimble.Foster.GUI</Text>
<Hbox Spacing="10">
<Button ID="Button">Click me!!</Button>
<Button>Button 2</Button>
<Button>Third</Button>
</Hbox>
</Vbox>
</Box>
</Template>
</GUI>
And the necessary C# to render it in your Foster app:
internal partial class Game : App
{
public Game() : base("Idler", 1600, 900)
{
Batcher = new(GraphicsDevice);
GUILoader = new(GraphicsDevice);
GUILoader.AddFont("Xerxes", "Xerxes 10.ttf");
GUI = GUILoader.HostFromFile("GUI.xml");
GUI.Transform = Matrix3x2.CreateScale(2);
if (GUI.Root!.FindChildByID<ButtonWidget>("Button", out var button)) {
button.FocusConfirmed += (o, e) => {
Console.WriteLine("Button pressed");
};
}
}
protected override void Update()
{
GUI.Update(Input);
}
protected override void Render()
{
Window.Clear(Color.CornflowerBlue);
GUI.Render(Batcher);
Batcher.Render(Window);
Batcher.Clear();
}
}