Astrina

Villager
Member
Joined
Jan 16, 2021
Messages
9
Reaction score
3
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,912
Reaction score
14,554
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
9
Reaction score
3
First Language
German
Primarily Uses
RMMV
Thank you, i was not aware of that.
 

Kaelan

Veteran
Veteran
Joined
May 14, 2012
Messages
809
Reaction score
556
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
9
Reaction score
3
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
809
Reaction score
556
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

Progress on one of my projects has been slow, but I'm at a spot now where I feel like sharing the four main characters.

From left to right we have: Amabel, Tibby, Dusty, and Wren.

tibbyrpgcast.jpg
I'm in a much better mood about my game than I was 2-3 days ago. I keep switching between sideview and front because of the amount of assets needed for side (I'm drawing it all myself)... but I've decided to stick with front, for my own sanity. sidenote... people, planning is important. I've spent so long on just getting my game's ideas off the ground because I didn't plan ahead.
unknown.png

"Fight me."
I'll finally wash my clothes today!
SA46ATTACK.gif :kaojoy:New Arab character in action.

Forum statistics

Threads
110,607
Messages
1,054,672
Members
143,736
Latest member
EmBee
Top