Manditory Edit box

This forum is currently in read-only mode.
  • I want to be able to pop up some sort of input box (e.g. like the edit box) that the player has to fill in with a value before being able to do anything else. It's for an inventory function so time scale =0 won't work for this since it is already zero, but there is inventory functionality happening (e.g. dragging and dropping items around). I also want to have it limit the input to a number. I don't want to check whether the input is a number, but instead I just want to disallow typing letters entirely, such that trying to type letters will not work (e.g. hitting a letter while typing will not make the letter appear).

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Place your events that concern the inventory in a group and make another event e�which deactivates the group unless a number is specified.

  • Thanks, but that doesn't take care of the second part. I don't want them to be able to type letters in the edit box at all

  • I can't think of a reasonable way to make an editbox accept only numbers, without using Python. So, here's a way with Python:

    EditBox: On text changed

    if len(EditBox.Text) > 0 and not EditBox.Text.isdigit():
    	EditBox.Undo()
    EditBox.ClearUndo()[/code:1au5r3n3]
    
    The python script would just be indented within the 'On text changed' condition. This makes use of, and basically takes away from the user, the ability to undo changes in the Editbox.
  • Hmm good idea. Is it possible to disable keyboard keys? I could try doing that too.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)