How do I spawn a sprite at position of a specific textstring

0 favourites
  • 3 posts
From the Asset Store
A set of 10 pixel art animated magic effects with icons. 2 Fire, 2 Earth, 2 Wind, 2 Water, Portal, Explosion.
  • Hi. Is it possible to somehow get the position of a letter or string inside a textobject or spritefont object? I know you can get the index where the string was found but is there a way to get the X and Y position? Something like "Press to start" and will be replaced with an image of a B button and the text will be replaced with "" to show only the button/sprite. Would be nice to show some images inside a text.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I am not sure if I got you right, but I give it a try! You could create a SpriteFont and replace some letters with images - have a look on the .capx! I replaced "Z" with an image and wrote "ZUTTON" to create the String! I erased small letters and numbers from the spritefont - you could use all the numbers to put images instead of them, for example! Or use the small letters, or make different SpriteFonts!

    I used blackhornets - SpriteFontGenerator_v2 from this forum to create a spritefont. I opened the spritefont with paint.net and replaced the "Z" with the image! For every "Z" you write with this spritefont the image appear!

  • Thanks. Good idea with Spritefont.

    This should work in most cases but if you need all chars to display lots of text (a huge wall of text!) is there another way to do it?

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