- Joined
- Apr 15, 2022
- Messages
- 7
- Reaction score
- 5
- First Language
- German
- Primarily Uses
- RMMV
For the general changing of the ingame font there are also plugins for the MV and theoretically you don't even need one, since you could change this directly in the file ''\fonts\gamefont.css" in your project folder.
But what if I only need a different font for a specific scene and then want to change it, e.g. via an event?
I tried to implement a solution for this myself and with some googling I managed to come up with a not-so-perfect Java workaround. (Or I found it somewhere and it works for the maker)
1. Pack the additional font into the "fonts" folder of your project as well
2. Copy the "gamefont.css" and name it e.g. "gamefont2.css".
3. Open this in a text editor of your choice as indicated above, Notepad also works.
4. In the third line, simply change the name of the original .ttf to the newly added font.
Finally, you can actually call this css with the following script call so that the font change is carried out at any point of an event:
Why am I writing this here? Because the change is not instant and there is no refresh command at the end of the script to change it directly.
I've tried a few things but couldn't find a solution. For a manual refresh while game is running, it is enough, for example, if I hover ingame with the mouse over an event which has 'hover_activate!' as 'Note'/'Comment'. (TDDP_MouseSystemEx)
So any call will also update the game interface. Probably also through other ingame actions...
Hope that it was somehow understandable what i need to complete that script.
Of course I would also be open to any better implementations, but since there doesn't seem to be a plugin for changing a font to everything at game (not only message-text) temporary and from event-call , I see black
But what if I only need a different font for a specific scene and then want to change it, e.g. via an event?
I tried to implement a solution for this myself and with some googling I managed to come up with a not-so-perfect Java workaround. (Or I found it somewhere and it works for the maker)
1. Pack the additional font into the "fonts" folder of your project as well
2. Copy the "gamefont.css" and name it e.g. "gamefont2.css".
3. Open this in a text editor of your choice as indicated above, Notepad also works.
4. In the third line, simply change the name of the original .ttf to the newly added font.
Finally, you can actually call this css with the following script call so that the font change is carried out at any point of an event:
JavaScript:
var cssId = 'myCss'; // you could encode the css path itself to generate id..
if (!document.getElementById(cssId))
{
var head = document.getElementsByTagName('head')[0];
var link = document.createElement('link');
link.id = cssId;
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = 'fonts/gamefont2.css';
link.media = 'all';
head.appendChild(link);
}
Why am I writing this here? Because the change is not instant and there is no refresh command at the end of the script to change it directly.
I've tried a few things but couldn't find a solution. For a manual refresh while game is running, it is enough, for example, if I hover ingame with the mouse over an event which has 'hover_activate!' as 'Note'/'Comment'. (TDDP_MouseSystemEx)
So any call will also update the game interface. Probably also through other ingame actions...
Hope that it was somehow understandable what i need to complete that script.
Of course I would also be open to any better implementations, but since there doesn't seem to be a plugin for changing a font to everything at game (not only message-text) temporary and from event-call , I see black
Last edited: