Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide GuiFloatValueBox() #343

Closed
danielchasehooper opened this issue Oct 2, 2023 · 6 comments
Closed

Provide GuiFloatValueBox() #343

danielchasehooper opened this issue Oct 2, 2023 · 6 comments
Labels
feature request new feature to be added

Comments

@danielchasehooper
Copy link

Sometimes people need to be able to view and edit float values

@raysan5
Copy link
Owner

raysan5 commented Oct 2, 2023

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.

@benjibst
Copy link
Contributor

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

@raysan5
Copy link
Owner

raysan5 commented Oct 31, 2023

@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.

@raysan5 raysan5 changed the title GuiFloatValueBox is needed Provide GuiFloatValueBox() Oct 31, 2023
@raysan5 raysan5 added the feature request new feature to be added label Oct 31, 2023
@benjibst
Copy link
Contributor

@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.

@benjibst
Copy link
Contributor

@raysan5 i made a pull request for this, would you mind taking a look?

@raysan5
Copy link
Owner

raysan5 commented May 7, 2024

Related PR #356. We can continue the discussion in there.

@raysan5 raysan5 closed this as completed May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request new feature to be added
Projects
None yet
Development

No branches or pull requests

3 participants