Showing Math equations in choices and dialog (exponents)?
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Showing Math equations in choices and dialog (exponents)?
So my teacher found out I could create games, and asked me to make a short game for her math class. Is there any way I could show all those x^2+y^2 on choices and dialog without the "^" and have them properly "raised"? I also kinda have a problem with the x/y things...
If worse comes to worst and there isn't, then I'll probably just make images of those but... >.< Deadline: tomorrow!
If worse comes to worst and there isn't, then I'll probably just make images of those but... >.< Deadline: tomorrow!
I don't have any kind words to spare to someone who already has all the reason in the world to feel good about himself.
http://roankun.wordpress.com/
http://roankun.wordpress.com/
- Aleema
- Lemma-Class Veteran
- Posts: 2677
- Joined: Fri May 23, 2008 2:11 pm
- Organization: happyB
- Tumblr: happybackwards
- Contact:
Re: Showing Math equations in choices and dialog (exponents)
I don't think there is a sub/superscript tag for text. But I do believe there are ALT codes that generate the numbers like that (1-3). But your font would have to support it, I think.
As for your slash problem, if you double them up (//) then it should show.
As for your slash problem, if you double them up (//) then it should show.
- PyTom
- Ren'Py Creator
- Posts: 15893
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: Showing Math equations in choices and dialog (exponents)
The superscripts are available as characters you. As long as you're using the default (DejaVuSans) font, you should be able to just copy them from this post into your game.
awesomebola(x) = x⁹ + x⁸ + x⁷ + x⁶ + x⁵ + x⁴ + x³ + x² + x¹ + x⁰
Graphs on Wolfram Alpha
awesomebola(x) = x⁹ + x⁸ + x⁷ + x⁶ + x⁵ + x⁴ + x³ + x² + x¹ + x⁰
Graphs on Wolfram Alpha
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom
Re: Showing Math equations in choices and dialog (exponents)
Thanks for the help on the exponents!
like... uhhh... It should appear like this.
x+y
x-y
Is there any way that... instead of a slash, it will be displayed as that big underline thing like in fractions?Aleema wrote:As for your slash problem, if you double them up (//) then it should show.
like... uhhh... It should appear like this.
x+y
x-y
I don't have any kind words to spare to someone who already has all the reason in the world to feel good about himself.
http://roankun.wordpress.com/
http://roankun.wordpress.com/
- netravelr
- Miko-Class Veteran
- Posts: 504
- Joined: Thu Jan 28, 2010 2:31 am
- Completed: Culina: Hands in the Kitchen, Culina: The Spirit of Cooking, Saving Zoey
- Projects: Love at the Laundromat
- Organization: Lakeview Interactive
- Deviantart: netravelr
- Location: USA
- Contact:
Re: Showing Math equations in choices and dialog (exponents)
You could put it like:
{u} puts the text in underlines and \n means a newline (so pressing enter basically)
Code: Select all
say "{u}x+y{/u} \n x-y"
Technical Designer/Programmer
Game Design Portfolio - Project updates on my Twitter
Experienced in: C/C++/C#, Python, Unreal, Unity, and Flash
_________________
"Space can be very lonely. The greatest adventure is having someone share it with you."
- PyTom
- Ren'Py Creator
- Posts: 15893
- Joined: Mon Feb 02, 2004 10:58 am
- Completed: Moonlight Walks
- Projects: Ren'Py
- IRC Nick: renpytom
- Github: renpytom
- itch: renpytom
- Location: Kings Park, NY
- Contact:
Re: Showing Math equations in choices and dialog (exponents)
I'll note that Ren'Py really wasn't meant for math rendering, which is a tricky field. If you want really good math rendering use TeX or something to make an image. (But I don't know an easy way to do that.)
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom(When was the last time you backed up your game?)
"Silly and fun things are important." - Elon Musk
Software > Drama • https://www.patreon.com/renpytom
Re: Showing Math equations in choices and dialog (exponents)
Thanks for the all help! I managed to manage, somehow. 
I don't have any kind words to spare to someone who already has all the reason in the world to feel good about himself.
http://roankun.wordpress.com/
http://roankun.wordpress.com/
Who is online
Users browsing this forum: Google [Bot]
