User Set Text

0 favourites
From the Asset Store
OpenAI TTS
$9 USD
10% off
Text-to-Speech plugin.Allows your Construct 3 project to convert written text into spoken words
  • You can do it by adding an event for each key you want to use. I used the clickable keyboard approach because I couldn't find a way of capturing a key press event for all keys (A-Z). I didn't want to create an event for each key pressed.

    If someone knows of a better way I'd love to know.

    If I understand what you mean correctly, you can compare whatever the user types to another text box or variable adding an ENTER key event.

  • Yeah I thought about it but it doesn't look like when you type it all out that it is one value, but many. So I have to come up with a way to have an event so that it will put it together as a value

  • The text is all one value. What you type is appended to the Text object (this displays all characters typed on screen). All you have to do is compare the Text box to whatever you want. I implemented an underline character as a cursor, so you will need to remove it from the Text string before comparing.

    I hope this helps.

  • Oh alright that is awesome. Thank you very much, this is incredibly helpful. Now I just have to wait for tile map support and .exe export features :D

  • I may just be talking out my ass here, but I think it would make sense to edit your exported html file to include a form (or have your game open a pop-up form when text is needed). Then you could have the Javascript for the game get the text from a good ole text input. You'd have to actually edit the code though after exporting your game. I haven't tried it yet and it's been too long since I've played with Javascript so it's still just a theory at this point.

  • ScottP, that might work if you made a plugin with the Javascript SDK, but otherwise it's probably too hard to edit the code by hand - it's all auto generated and not easy to work out.

  • It appears I need to jump back into javascript and see if I can make a Text Input plugin. If anyone wants to help....or if anyone beats me to it, lemme know.

  • I believe all you have to do is set up an event that passes the value in the text box into a variable.

    pseudo code e.g. "on keyboard:shift.pressed >> system >> set value

    select the variable e.g. worldName1

    set the value e.g. str(yourTextBoxName.Text)

    ::: the str() converts the text into a string value. You could use str() if you wanted your worlds to be named using words.

    or

    int() / float to convert the input to an integer or floating point value! For naming worlds with numbers.

    From there you can use the general text object to render the text on canvas: e.g. Add event: system >> every_tick >> set text >> "This world is called "& worldName1

  • My 2-Cent....there is an object called Text-Box and another just for Text. If I need some "work-around" to retrieve the user entered text, why have to seperate objects?

    ...or, differently phrased, will there be a "get text" method in the near future?

  • HI simwhi

    Ive tried your virtual keyboard and it works nice

    BUT on android it triggers the key-letters twice ...

    also the DEL and SPACE

    Is there a workaround, I use the on touch object

    Regards

    Flemming

  • I would go with the Text Box object, like Jubalicious87 described.

  • flemmig

    I have never noticed that before. We have used a virtual keyboard in all of our games without any issues. Which version of C2 are you using? I will check it out.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Links work fine

  • simwhi - Link not working anymore...

  • simwhi : Could you please upload the capx again?

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