How do I turn typed text into sprites?

0 favourites
  • 7 posts
From the Asset Store
A well commented RPG game template to learn from or use as a base for your own game!
  • For my English grammar game (super exciting, I know) I have a text box. I want to type in a sentence, for example "I love fishing" and I want to hit return and turn the individual words in that sentence into sprites.

    So, after I hit return I have 3 different sprites, one that says "I", one that says "love", and one that says "fishing". Then you can move them around and rearrange the sentence and whatnot but I know how to do that part. I don't know how to get them from the text box to moveable sprites.

    Any help would be much appreciated.



  • In this example I create a sprite with drag and drop behaviour and a text object with pin to behaviour, I then pin the text to the sprite. maybe this will help you. <img src="{SMILIES_PATH}/icon_e_wink.gif" alt=";)" title="Wink"> ... sp=sharing

  • Here's an update, its a bit rough and ready but does what you need, me thinks. ... sp=sharing

  • Thank you very much. That's exactly what I needed. It's hard to know where to start on these projects.

    I took the example2 and I added a text box and changed it so that the text in the text box becomes the split text and it works great.

    I ran into this problem now: if you type "I love watching TV" and hit enter it works, it makes each word a sprite. But then if I type in something different and shorter after it still reads that last sentence, so if I type in "I have" and it enter it will spit out "I" "have" "watching" "TV". I'm studying up on arrays and different stuff in your event sheet i didn't understand so hopefully I figure the answer on my own but I figured I would ask.

    Thanks again, really appreciate it.

  • Ahhhh okay I see now, it's making the sprites from the array, and they are still in the array from the sentence before. Answered my own question.


  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • korbaach Wow, that's fantastic. Thank you very much.

    I see you randomly assigned colors to them with the animation frames on the sprites. I want to, and know I know I can, assign certain parts of speech to their own specific colors.

    For example, I would want all pronouns to be blue. Pronouns being "I, you, he, she, it...etc". I can find a way to make them blue, but only because there aren't too many of them. I can say if text="you" or if text="he" then make it blue.....But with something where there are thousands of possibilities what would I do?

    If I wanted all verbs to be red, there are thousands of verbs in English, so I can't just enter them in like I did with the blue pronouns. How would I go about that? If it's even possible



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