HeroEngine Forums

HeroEngine Support => GUI Creation => Topic started by: AWW_boss on Mar 02, 14, 11:24:23 AM

Title: text input that allows only positive numerical characters typed in
Post by: AWW_boss on Mar 02, 14, 11:24:23 AM
Hi!

As the title says, what would be the easiest way to accomplish this?

Best regards
Title: Re: text input that allows only positive numerical characters typed in
Post by: FI-ScottZ on Mar 02, 14, 03:45:13 PM
I believe you would want to use the _numericInputBox control. Its class is GUINumericField which has a field to force input to be an integer and you can set a valid range for it. That's if you only want a box; if you want up/down arrow buttons as well then use _numericField.
Title: Re: text input that allows only positive numerical characters typed in
Post by: AWW_boss on Mar 03, 14, 12:37:23 PM
Thanks, it was just the thing i was looking for. But, i noticed that it places the integer in the upper right corner of the control. I'm struggling to find a way to place it in the bottom left corner, just like the ordinary text input box does. Any idea how to do this?
Title: Re: text input that allows only positive numerical characters typed in
Post by: FI-ScottZ on Mar 03, 14, 04:15:51 PM
Not directly, but you can try different fonts, font size (I think), and I believe there is a field which is something like offset or something that seems to move the text around, but it is not easy to really get it where you want ala the justification of normal text boxes.
Title: Re: text input that allows only positive numerical characters typed in
Post by: AWW_boss on Mar 03, 14, 05:15:48 PM
Blah, i ended up using a plain text input box and forcing a number on it with HE_onKeyUp and HE_onLostFocus. It's not perfect, but it fits my needs better then the numerical input.