2D Toolkit Forum

2D Toolkit => Support => Topic started by: TekuStudios on January 05, 2016, 01:52:11 pm

Title: Combine text and images in subtitles - is it possible?
Post by: TekuStudios on January 05, 2016, 01:52:11 pm
Hi!

I'm adding the final touches for the tutorial of our game, and I'm trying to figure out how to do some specific thing. When we teach the player about the game's controls, I'd like to combine text and images so I can have something like this:

Quote
To jump, press [JUMP BUTTON]. To run, press [RUN BUTTON]

Where [JUMP BUTTON] and [RUN BUTTON] are not text, but images (keyboard keys or controller buttons, depending on what input method you're using). It shouldn't be too difficult, but I'm not quite sure on the best approach. And the thing is that we have languages such as English, Spanish, Russian, Japanese... so the texts are completely different sometimes depending on the active language, and since I can't have a consistent text structure I need to come up with a custom solution for this.


Any ideas?
Title: Re: Combine text and images in subtitles - is it possible?
Post by: unikronsoftware on January 07, 2016, 11:01:02 pm
Hi there, it is with a bit of work.
1. Find some empty space in source font texture you're importing.
2. Insert your images into the font in image editor of your choice.
3. Modify your fnt file, using characters you don't use in your font and create entries for them. It should be pretty straightforward, and you can then import as you do with normal charcters.
Title: Re: Combine text and images in subtitles - is it possible?
Post by: TekuStudios on January 08, 2016, 11:46:34 am
Nice, thanks a lot!

I'll definitely try that with BMFont :)