How do I spawn a sprite at a specific word in text?

0 favourites
  • 3 posts
From the Asset Store
Animated Text
$3.99 USD
With AnimatedText behavior you can make an impression of the text being “typed live”.
  • Hi all,

    I just wondering if there is any way to spawn a sprite at a specific word in a text. For example: "The quick black fox jumped over the lazy dog". When 'the' is in the text it spawns a sprite behind/above 'the' text word.

    I hope that makes sense.

    Thanks for the help!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I would use a hidden text object but only fill it with text up to and including the space before the word you're interested in. Use the text width property (not the text object width) and add it to the text object's bounding box left position. That will give you the starting/left x position. You could also measure the width of a single word using a similar technique. Just note that it takes one tick for these text width values to populate after signing the text content.

  • Or you can put invisible sprite/spawner and put in every word or text you have then spawn na sprite you want to spawn on the invisible sprite/spawner. Happy building!

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