Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dcubix/flexer
Simple flexible layout engine for C++
https://github.com/dcubix/flexer
flexbox flexible layout-engine
Last synced: about 18 hours ago
JSON representation
Simple flexible layout engine for C++
- Host: GitHub
- URL: https://github.com/dcubix/flexer
- Owner: DCubix
- License: mit
- Created: 2021-03-28T00:06:50.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-07-12T02:41:46.000Z (4 months ago)
- Last Synced: 2024-07-13T03:48:46.073Z (4 months ago)
- Topics: flexbox, flexible, layout-engine
- Language: C++
- Homepage:
- Size: 63.5 KB
- Stars: 9
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Flexer
Header-only, simple, flexible layout engine for C++.
# Example
```cpp
auto flex = std::make_unique();EID par1 = flex->createElement({
.bounds = Rect(10, 10, ScreenWidth() - 20, ScreenHeight() - 20),
.axis = Axis::Vertical
});
EID par2 = flex->createElement({
.parent = par1,
.bounds = Rect(0, 0, 0, 80),
.proportion = 0,
.axis = Axis::Horizontal
});flex->createElement({
.parent = par2,
.bounds = Rect(0, 0, 120, 0),
.proportion = 1
});flex->createElement({
.parent = par2,
.bounds = Rect(0, 0, 120, 0),
.proportion = 0
});flex->createElement({
.parent = par2,
.bounds = Rect(0, 0, 120, 0),
.proportion = 1
});
```## Result
![Centering an element with a fixed size](https://i.imgur.com/sfOVew0.png)