Text input allowing modifying a value (SOLVED)

For debugging I’d like to change a date stamp text field in my game at runtime, like in this video:

After a little digging there doesn’t seem to be an easy way to do this in Defold?

The most basic example doesn’t have a cursor:

Druid doesn’t seem to have a cursor:
https://insality.github.io/druid/druid/?example=general_input

Dear IMGUI doesn’t seem to have a text input component:

Gooey also doesn’t seem to have cursor support:
https://britzl.github.io/Gooey/

Is there a different simple approach that I’m missing?

For now I didn’t see any solution for cursors in input fields

But I’m sure it’s possible to do even with just single text with resource.get_text_metrics, but can be a little tricky :slight_smile:

I’m using Druid (awesome, btw!) and in the end I just split the date up into separate text inputs for year, month, day etc. A bit clunky, but works.

1 Like

Hmm, it should have one… let me check…

(a few moments later)

Yes there is imgui.input_text(label, text, [flags]) (and it does have cursor support)!

3 Likes

Amazing, thanks! It works a treat.

1 Like