How do I do superscript/subscript within CocoonJS or Ejecta?

Get help using Construct 2

Post » Tue Apr 29, 2014 8:21 pm

I am looking to create an iOS app (Ejecta or CocoonJS) that dynamically loads questions and displays superscript, subscript, and the special characters theta and the degree symbol.

My proposed solution using sprite fonts is this:
1. Parse the text word by word.
2. For every word, create a sprite font object.
3. Position each sprite font object to the right of the previous object, or if at the end of a line, wrap to the next line.
4. Determine if that word is supposed to be superscripted/subscripted. If so, adjust the line height up/down an appropriate number of pixels.
5. Continue until all the text is parsed.

Does anyone have any experience trying to use spritefonts or the text object to do superscripts/subscripts?
Is it possible to load the degree symbol or the theta symbol with sprite fonts?
Am I missing something obvious?
www.simbucket.com - HTML5 Science Simulations / https://www.airconsole.com/#!play=com.n ... obotrumble - Robot Rumble on AirConsole
B
48
S
14
G
20
Posts: 374
Reputation: 14,586

Return to How do I....?

Who is online

Users browsing this forum: amazingdream, lordsas, mekonbekon and 49 guests