raygui
raygui copied to clipboard
Provide `GuiFloatValueBox()`
Sometimes people need to be able to view and edit float values
Yeah, I agree but that's actually a quite complex function, the "dot" possition depends on the locale of the system and could be difficult to manage properly.
I tried to make this today because i needed it myself, but i got stuck because when editing the float value's decimal places (pressing backspace), on the next function call they are printed out again. I think this needs some external text memory where you first edit the text and then update the value. @raysan5 pls let me know what you think, im trying to help but idk if this is the right approach
@benjibst Afaik, approach should be similar to GuiValueBox()
but parsing the value as a float
(instead of int
) and probably limiting it to 3 decimal positions.
@danielchasehooper I made this now, on my profile you can find a fork to raylib and raygui if you still need it. the usage is a bit different, you have to provide a data buffer when you call the function where it stores the string representation of the float.
@raysan5 i made a pull request for this, would you mind taking a look?
Related PR https://github.com/raysan5/raygui/pull/356. We can continue the discussion in there.