Check if Keyboard Input Value is allowed
My keyboard input is for a number of how many items the person would like to buy. Is there a way to check the limit they try to enter before it changes the value to what they typed?
I've tried setting a behavior on an actor on the scene to constrain the value to the value's max limit if the value is over the max, but it doesn't change it after the keyboard input is entered, even if i put a timer for every 1 second on it too.
I've tried setting a behavior on an actor on the scene to constrain the value to the value's max limit if the value is over the max, but it doesn't change it after the keyboard input is entered, even if i put a timer for every 1 second on it too.
Best Answer
-
tatiang Posts: 11,949
There's no way to check keyboard input on the fly (while typing). You can use a custom keyboard, but I think in this case it would be best to have +/- buttons and a DisplayText behavior to show the current value of the quantity. Unless you need them to buy 5000 of something (in which case maybe you could have +1/-1, +100/-100, etc. buttons). Then you could check or constrain the quantity as it changes.New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Answers