Check if Keyboard Input Value is allowed

BluSpyderBluSpyder Member Posts: 129
edited September 2012 in Working with GS (Mac)
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.

Best Answer

  • tatiangtatiang Posts: 11,949
    Accepted Answer
    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

  • BluSpyderBluSpyder Member Posts: 129
    Ok. Yeah I already do have +/- buttons that constrain the value, it was just the keyboard input that for some reason won't constrain after input. But in some cases it could get to the thousands, so i guess I'll just put more buttons on for 100's and 1000's.

  • BluSpyderBluSpyder Member Posts: 129
    edited September 2012
    Thanks.
Sign In or Register to comment.