Hello everyone,
For my new game, I chose Lemur as my GUI and I like it so far.
But I have two questions: How can I freely layout elements without the container resizing them (manually set size and position), because it currently just overrides my manual settings.
And how do I determine the slider value from 0 - 1?
It also supports long, float and byte values I think.
Lemur isn’t big on relative and manual settings as far as I know (inb4 Paul comes around to say WRONG!). I’ve had most success with the SpringGridLayout, setting PreferedSizes and Insets.
If you just want the slider value then you can just grab it:
slider.getModel().getPercent() : value between 0 and 1 representing the scaled min to max.
slider.getModel().getValue() : value between min and max inclusive.
Regarding the layout question:
If you want no layout at all then just don’t put things in a container. They’re just spatials and you can position them however you want attached to whatever node you want.
It’s almost always better to use a layout and control things with their preferred sizes and/or insets. But the other option is always available.