How do I make this: pressing any letter in keyboard will append that letter in a text?

0 favourites
  • 5 posts
From the Asset Store
Game with complete Source-Code (Construct 3 / .c3p) + HTML5 Exported.
  • Hello!

    I know a way how to do this, make an event, set it to "when A pressed in keyboard append A to the text, then make it with every letter. So my question, is there any shorter way to make this, without setting an event for each letter?

  • First question, is there a reason you can't use a text input object?

    Second try this out and see if it will work for you.

    + Keyboard: On any key pressed

    + System: len(str(Keyboard.TypedKey)) = 1

    -> Text: Append Keyboard.TypedKey

    The second condition just ensures that the text is only appended if the length of the typed key is 1.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • For your question: I can use text input, but with Text object I can change the background color, font etc. So I just wondered if it would possible to make it with a simple Text.

    For your solution: Thanks for reply, but could you help me a bit more, because I got stuck at which action should I choose to write the code in the second step.

  • + Keyboard: On any key pressed

    + System: len(str(Keyboard.TypedKey)) = 1

    -> Text: Append Keyboard.TypedKey

    means

    Hopefully that helps. The whole thing is a single event. the + represents conditions and the -> represnts the action. This is how construct outputs events when copied to text.

  • Oh I get it, trying your solution now...

    Thanks, it works

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