AdamSakuru

[Null_Value]
Veteran
Joined
Mar 14, 2014
Messages
314
Reaction score
171
First Language
English
Primarily Uses
N/A
https://victorenginescripts.wordpress.com/rpg-maker-mv/damage-popup/
I'm using Victor's Damage Popup plugin and there's a parameter for "Font Face"

Code:
-Popup Fontface
The parameters 'Fontface' defines the font name for the popup display.
You can use script codes that returns a string with the fontname se the
value for it.

But I'm not sure how to do this. Would anyone know the right way? By default it's this:
Code:
this.standardFontFace()
 

kovak

Silverguard
Veteran
Joined
Apr 3, 2016
Messages
1,264
Reaction score
1,565
First Language
PT - EN
Primarily Uses
RMMV
this.fontFace = 'font name'

as far as i know they need to be in .ttf format to work
 

Aloe Guvner

Walrus
Veteran
Joined
Sep 28, 2017
Messages
1,628
Reaction score
1,123
First Language
English
Primarily Uses
RMMV
Not quite, the way Victor set it up, it requires a function (because he uses the eval command on it, it can't just be the name of the font as a simple string).

This is the default function:
Code:
Window_Base.prototype.standardFontFace = function() {
   if ($gameSystem.isChinese()) {
      return 'SimHei, Heiti TC, sans-serif';
   } else if ($gameSystem.isKorean()) {
      return 'Dotum, AppleGothic, sans-serif';
   } else {
      return 'GameFont';
   }
};

So it stands to reason you could insert this code into the plugin somewhere:
Code:
Window_Base.prototype.myFontFace = function() {
   return 'XXXXXXX';
};
Where XXXXXXX is the font-family defined in your gamefont.css file.

And then your parameter in the plugin would be:
Code:
this.myFontFace()
 

AdamSakuru

[Null_Value]
Veteran
Joined
Mar 14, 2014
Messages
314
Reaction score
171
First Language
English
Primarily Uses
N/A
Not quite, the way Victor set it up, it requires a function (because he uses the eval command on it, it can't just be the name of the font as a simple string).

This is the default function:
Code:
Window_Base.prototype.standardFontFace = function() {
   if ($gameSystem.isChinese()) {
      return 'SimHei, Heiti TC, sans-serif';
   } else if ($gameSystem.isKorean()) {
      return 'Dotum, AppleGothic, sans-serif';
   } else {
      return 'GameFont';
   }
};

So it stands to reason you could insert this code into the plugin somewhere:
Code:
Window_Base.prototype.myFontFace = function() {
   return 'XXXXXXX';
};
Where XXXXXXX is the font-family defined in your gamefont.css file.

And then your parameter in the plugin would be:
Code:
this.myFontFace()

I apologize if this is obvious bit I'm unfamiliar with this stuff. How do I set it to a font that is not the game font?
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
2,279
Reaction score
1,687
First Language
EN
Primarily Uses
RMMZ
Assuming you have the font and the permissions (if required) to use it: copy the font file into your project's fonts subfolder, then use Notepad or something to open the gamefont.css file (found in the same folder) and add this:
Code:
@font-face {
    font-family: FontLabel;
    src: url("font-name-goes-here.ttf");
}
Replace FontLabel with whatever you like, e.g. PopupFont. The font-family label is what's used in the code to refer to this font. As you can see, the actual filename goes in the brackets on the next line. Then for the parameter in Victor's plugin I'd suggest trying this:
Code:
String('FontLabel');
Again, replace FontLabel with whatever you called it in the CSS file. I think this should work around the eval without the need for additional code, though I haven't tested it myself... :kaoswt:


If you don't have a licence/permission to distribute the font you want to use but it can be expected to be present on the players' systems (e.g. if you want to use Segoe UI on Windows systems), this old thread on the Steam Discussions may be of interest: https://steamcommunity.com/app/363890/discussions/1/1318836262668686748/
 

AdamSakuru

[Null_Value]
Veteran
Joined
Mar 14, 2014
Messages
314
Reaction score
171
First Language
English
Primarily Uses
N/A
Thanks to the both of you for the help. I got it working.
 

Aloe Guvner

Walrus
Veteran
Joined
Sep 28, 2017
Messages
1,628
Reaction score
1,123
First Language
English
Primarily Uses
RMMV
@caethyril That's a clever trick, I didn't think of using the String global object to get around the eval!
 

Latest Threads

Latest Profile Posts

I've just finished organizing music files from a music Humble Bundle I purchased a while ago (putting in specific themed playlists, deleting from playlists, deciding which games they'll be used for. etc.). I'm feeling pretty confident that the sound design for my games will be up to high standards. Sound design seems to be relatively under-discussed as a topic in game development imo.
So I just got back from SeaWorld and I'm back to working on my game. I'm stuck on Shadowstar, mainly due to needing two more princesses... I have all the canon and toy princesses, plus Sunset Shimmer just for kicks. I decided not to include Cadence since this isn't in that era. But... I'm going to have to design two OCs now.
I'm completely missing on this site :kaodes: How's everybody doing lately?
3dlm3XK.jpg
I'm looking at/working through a simple game tutorial. Town, dungeon, boss; town, dungeon, boss; etc. (Thanks, Yanfly!) I'm itching to make something complex but experience (and past disappointment!) tell me to go slow and learn.

Rome certainly wasn't built in a day. 〜( ̄▽ ̄〜)
SF_People1_2 added!
index.php

Forum statistics

Threads
109,181
Messages
1,042,795
Members
141,677
Latest member
Rot-Fuxs
Top