raygui icon indicating copy to clipboard operation
raygui copied to clipboard

```GuiTextBox``` has no delta time

Open Ioxcv12 opened this issue 8 months ago • 5 comments

Exactly this, when setting the FPS of my game to 240 the text deletes too fast, but when setting it to 60 it deletes fine and at the "correct" speed. This is probably a symptom of GuiTextbox having no delta time.

Ioxcv12 avatar Mar 21 '26 04:03 Ioxcv12

This probably can be fixed by multiplying the frame count with the delta time but that's not a great solution as it will require external Raylib linkage

Alternative solution: put two int arguments as inputs for GuiTextBox? But this solution is not compatible with previous versions of raygui. I guess I can somehow make the arguments optional? But I'm not sure how that can be done in C99, perhaps variadic macros? [would require renaming it internally to GuiTextboxInternal or something similar]

Ioxcv12 avatar Mar 21 '26 04:03 Ioxcv12

Maybe RAYGUI_TEXTBOX_AUTO_CURSOR_COOLDOWN is the one to use? Bit weird, but if you can confirm then I should close this issue.

Ioxcv12 avatar Mar 21 '26 04:03 Ioxcv12

Okay, these are defines that cannot be changed during runtime so I guess this may be needed?

Ioxcv12 avatar Mar 21 '26 07:03 Ioxcv12

Decided to just make my own macro for raygui that edits GuiTextBox to be the default and GuiTextboxTimed to have a time parameter so that it can be changed during runtime. Worked fine for me. I'm not sure how this'll affect many other projects, though.

Ioxcv12 avatar Mar 24 '26 04:03 Ioxcv12

@Ioxcv12 To keep it simple, raygui timming is dependant on application for now, also to avoid additional dependencies

raysan5 avatar Jun 01 '26 10:06 raysan5