Implement vertical meters.
This commit is contained in:
parent
ad116b5515
commit
48b672eec4
3 changed files with 26 additions and 4 deletions
|
|
@ -15,13 +15,23 @@ struct TestMeters {
|
|||
|
||||
void init() {
|
||||
$gui.position(0, 0, 1280, 720);
|
||||
$gui.layout("[meter1][=meter2][meter3][meter4]");
|
||||
$gui.layout(
|
||||
"[*%(300,100)meter1|_|_|*%(100,400)vert1|*%(100,400)vert2|*%(100,400)vert3]"
|
||||
"[*%(300,100)meter2|_|_|_|_|_]"
|
||||
"[*%(300,100)meter3|_|_|_|_|_]"
|
||||
"[*%(300,100)meter4|_|_|_|_|_]");
|
||||
|
||||
for(auto& [name, cell] : $gui.cells()) {
|
||||
auto gui_id = $gui.entity(name);
|
||||
|
||||
$gui.set<guecs::Rectangle>(gui_id, {guecs::THEME.PADDING, {120, 25, 25, 255}});
|
||||
$gui.set<guecs::Meter>(gui_id, {1.0f, guecs::THEME.DARK_LIGHT, guecs::THEME.PADDING});
|
||||
|
||||
if(name.starts_with("meter")) {
|
||||
$gui.set<guecs::Meter>(gui_id, {1.0f, guecs::THEME.DARK_LIGHT, guecs::THEME.PADDING});
|
||||
} else {
|
||||
$gui.set<guecs::Meter>(gui_id, {1.0f, guecs::THEME.DARK_LIGHT, guecs::THEME.PADDING, true});
|
||||
}
|
||||
|
||||
$gui.set<guecs::Effect>(gui_id, {});
|
||||
$gui.set<guecs::Text>(gui_id, {guecs::to_wstring(name)});
|
||||
$gui.set<guecs::Clickable>(gui_id, {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue