Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/codecat/nimble.layout
Layout system for .Net based on layout.h.
https://github.com/codecat/nimble.layout
Last synced: 6 days ago
JSON representation
Layout system for .Net based on layout.h.
- Host: GitHub
- URL: https://github.com/codecat/nimble.layout
- Owner: codecat
- License: mit
- Created: 2024-08-11T20:08:55.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-08-11T20:33:32.000Z (5 months ago)
- Last Synced: 2024-08-11T21:39:42.140Z (5 months ago)
- Language: C#
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: License.txt
Awesome Lists containing this project
README
# Nimble.Layout
Layout system for .Net based on [`layout.h`](https://github.com/randrew/layout).## Example
```cs
var root = new LayoutItem {
Size = new(1280, 720),
Contain = ContainFlags.Row,
};var masterList = new LayoutItem {
Size = new(400, 0),
Behave = BehaveFlags.VFill,
Contain = ContainFlags.Column,
};
root.AddChild(masterList);var contentView = new LayoutItem {
Behave = BehaveFlags.HFill | BehaveFlags.VFill,
};
root.AddChild(contentView);root.Run();
MyUiLibrary.DrawBoxXYWH(
masterList.Rect.X, masterList.Rect.Y,
masterList.Rect.Width, masterList.Rect.Height
);
```## Notes
This is a direct port of `layout.h` without too many modifications besides making it more OOP-friendly and some common C# things.Tests from `layout.h` were ported to C#, and they all pass, so I'm rather confident in the reliability of this library.
Performance is still mostly untested, although there is a `Nimble.Layout.Benchmark` project that should match the one in `layout.h`. Initial testing shows that this library is about 4 times slower than its C counterpart. I have not yet narrowed down the exact cause.
Most of the documentation is copied straight from the C code. This will be fixed eventually.