How do I limit text to one line + blinking cursor? (SOLVED)

0 favourites
From the Asset Store
solution for games like "fruit ninja" and drawing applications
  • why you want to keep the left key down when you are typing ????

  • Lol, thanks for the video! You game looks cool!

    What I meant though is what happens when you press "Left" key on the keyboard:

    For example: you type "DESTRROY ALL HUMANS" and then you notice you made a mistake in the word "DESTROY" and you press Left key several times to move cursor there and correct it.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • you can do whatever you wan with the keys you just need to give the right formula position in X to the blinking cursor ! and you can also play with x,y and scale too ( for a selection

    square for example)

    if you add an event every tick left key down, then you can change the formula for the blinking cursor and it works every time !

    if you did a mistake in your text dont use left but just use backspace, that's what i do and it remove the wrong letter (like in the video)

    for example if i type something wrong in my app i just added a function "enter" erase everything typed in text box and then you restart typing

  • The problem is - you can't detect "Left key is down" when cursor is inside the TextBox. It's not possible in Construct 2!

    That's what I was trying to tell you!

    I know you can erase with Backspace, but some people prefer pressing Left key or Home key if they want to correct a mistake in the beginning of the line and don't want to re-type everything. And if they press any of these keys, the real cursor will move, but your fake sprite cursor will not.

  • yeah and also the text box is too limited without options, like: text selected > then >change to > "" this is something working at the perfection with Fusion 2.5 and text boxes, but in construct 2 we have tons of little limitations who make things more complex to achieve !

  • I suggest you do this without the TextBox. Use Text or SpriteFont object.

    It's easy -

    "On Any Key Pressed" if it's on of the letters/numbers, add it to the text. If backspace pressed, remove last character from text. On Enter, submit the string. And ignore all other keys.

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