Astrina

Villager
Member
Joined
Jan 16, 2021
Messages
8
Reaction score
2
First Language
German
Primarily Uses
RMMV
Hi,
for a math-oriented game i would like to use something like this:
<!DOCTYPE html>
<html>
<head>
<title>MathJax TeX Test Page</title>
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script type="text/javascript" id="MathJax-script" async
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js">
</script>
</head>
<body>
When \(a \ne 0\), there are two solutions to \(ax^2 + bx + c = 0\) and they are
$$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$
</body>
</html>

which should render to the attached output in a message box.
I am new the rpg maker, so perhaps i simply haven't used the right terms for the search.
 

Attachments

  • math.png
    math.png
    7 KB · Views: 2

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
41,215
Reaction score
14,248
First Language
English
Primarily Uses
RMMV

I am moving this to Plugin Requests



I imagine there would be some way via script to do this, but anything adding new functionality to the text box will require a plugin.
 

Astrina

Villager
Member
Joined
Jan 16, 2021
Messages
8
Reaction score
2
First Language
German
Primarily Uses
RMMV
Thank you, i was not aware of that.
 

Kaelan

Veteran
Veteran
Joined
May 14, 2012
Messages
806
Reaction score
551
First Language
Portuguese
Primarily Uses
RMMV
You should look into how windows in MV work. You'll have to make your own Window class and use the javascript DOM API to manipulate DOM elements to do whatever you would have done with them in HTML.

I had to do this to implement UTF-8 support for text boxes in the Knight Editor, you can look at the code here, here, and here if you want an example of the sort of things you need to do.
 

Astrina

Villager
Member
Joined
Jan 16, 2021
Messages
8
Reaction score
2
First Language
German
Primarily Uses
RMMV
Wow, that looks overwhelming at the first glance. I will have to download your plugin and see the way it looks and try to combine it with your code.
Thank you very much for giving me a starting point!
 

Kaelan

Veteran
Veteran
Joined
May 14, 2012
Messages
806
Reaction score
551
First Language
Portuguese
Primarily Uses
RMMV
There's a lot of code there mostly because I wrote my own extension to the default Window class, so I could add a bunch of extra features to it that make it a bit easier to write complex UI, and so I could avoid having my changes overwrite the regular windows people use for their game while they're using my plugin.

You don't really need to do any of that if you don't want to though, if all you care about is getting HTML elements inside a window, you should be able to get that by mostly just making your own version of the EditorHTMLTextInput class and putting it in your own Window.

There's a few snags to getting it to work correctly, so if you have any questions about it feel free to ask
 

Latest Threads

Latest Posts

Latest Profile Posts

Hi everyone! I've relased a demo about my new game in "Games in Development". Someone interested? :3
Going live at 2pm EST
Today is the day! I will be productive in game dev work! I will - *gets distracted by cat playing with her toy mouse* Awww <3
Whelp. I tried to be productive.
Decided to work on Fandom Scouts today. I've decided that instead of using the generic "scrolling text" event that MV has (I'm using MV for FS, not MZ) I'll use the movie option. I'm still trying to find a way to get Premiere Pro to output the compatible format though. If anyone can give me some help, it would be greatly appreciated!
Barthdry wrote on tln143's profile.
Hello tln143 Welcome to the RPG Maker Forum. We wish you enjoy and make good rpg games

Forum statistics

Threads
109,039
Messages
1,041,550
Members
141,526
Latest member
arjuna
Top