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: 3

Shaz

Keeper of the Nuts
Global Mod
Joined
Mar 2, 2012
Messages
46,153
Reaction score
16,958
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

Regular
Regular
Joined
May 14, 2012
Messages
811
Reaction score
570
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

Regular
Regular
Joined
May 14, 2012
Messages
811
Reaction score
570
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 Profile Posts

QuestMZPlugin.png

My first foray into a plugin that I plan to release. Working on something for those who want to set up a Dragon Quest style battle HUD with minimal fuss. Includes the ability to round the battleback corners to fit your windowskin and, of course, front-view animations.

QuestMZPLugin_CustomWindow.png
Do you ever wonder where the heck everyone is going at 9:00 at night? Like... guys, go home! Get some sleep! Me? Oh, I'm out to get pizza 'cause I decided supper time was 9:30 tonight.
Updated my map with new terrain, improved the water and added some fishes, also added a beautiful rainbow!

SpyroFan67 wrote on lebees's profile.
7 Grand Dad

Forum statistics

Threads
134,754
Messages
1,250,329
Members
177,515
Latest member
CJMZ
Top