Integer spin box in widget?

Hello, I wonder if there is any way to make a spin box increase and decrease its value by 1 instead of float comma values. I’ve been struggling with this for a while.

I want the user to be able to drag and pick 2, 3 or 4 players. Not 2.510565…

I’ve tried changing the delta value to 1 but no avail.

Some people had a similar post but changing the delta didn’t do the trick for me. The same goes for other projects and previous versions of the engine. I haven’t found any other information on how to do this. Any help would be very welcome. Thank you in advance!

300555-ue4.jpg

I know this is dumb but that’s one of those things UMG does not cater for.

Bind the Display Float to the spinbox.

Thanks a lot! That fixed it for me. It’s a dirty workaround indeed but as long as it works…
The value still says “2.0” or “3.0” … instead of round numbers like 2 and 3 though, any idea? The main problem is fixed, I’m glad though so it’s fine.

Thanks for the suggestion and all your help, I’ll definitely have a look and see what else I can do to make it work or use a different method like your suggestion.

Ah you’re right. Spinbox seems to take floats only and can’t be bound to anything else. I’ll poke it but my gut feeling tells me it’s not going to budge.

A half decent alternative can be an overlay with a slider and a text box - should give you full control over formatting.

You can force mouse delta to use step:

300589-step.png

and will end up with:

Image from Gyazo

And text formatting as in the original example. In addition, you could place a progress bar underneath and read the value of a slider and push it into the progress bar - that should imitate what the spin box is showing but with way more granular control.

2 Likes

Change these parameters in the slider options

3 Likes