Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 TIPS AND TRICKS
#2
FONT:  Setting the Default Font



The easiest method of changing the font of your entire game is adding the line:
Code:
Font.default_name = "Arial"

Drop that in the main method, or just have it as a script of its own.



Explanation and options time now...


Since its inception, you were stuck with the default font with your RPGMaker system. This is true for all language formats, whether the original Japanese version or the legally procurable Western/English version.  Japanese users were always finding MS Mincho on their screens while Western users would find Tahoma as their typically visible font.


Back in the early days before an English version was available, users discovered that the saw now text in their games and demos. They discovered that the font was set to a Japanese font not installed. So clever coders developed techniques like creating a $default_font value and edited all the windows and code to use the font they defined with that variable. Or they would use a patch made by a scripter named Minkoff.  Both techniques worked, though relied upon the most work to set the game's font.


Changing the font of your game to another merely requires one simple command:


Code:
Font.default_name = "Arial"


The font class itself is a fun class, and has five properties you can actually change:  default_name, default_size, default_bold, default_italic and default_color. But first about default_font.


The Font.default_name value lets you set the default font of all of your game's text, with the exception of RPGMaker XP's battle system's damage* pops, contained in the Sprite 'damage' method.  The above example makes your game run with the Arial font.  But you are not limited to just one font with this command, but a list as you can see below:


Code:
Font.default_name = ["Radagast","Courier New","Tahoma","Arial"]


This simple line allows you to set four different fonts to your game. If the person playing your game doesn't have the first font in the list, it will then try to render the text with the second font, then the third, and so on.  And I have seen a few demos where ten different fonts were specified.  You may be supplying your own custom font. But if the font didn't properly install, you have the ability to set alternatives.


Of course, this won't change any font of a custom script that has its own 'pre-defined' font.


I hope that this will alleviate anyone's issues with changing the font of their game to something custom, and issues that may arise if the intended player cannot see any text.






Of the other defaults, they only allow for one entry each.

Code:
Font.default_size = 24



You may likely not change the size of the font, but the setting of '24' is the normal default setting.

Code:
Font.default_bold = false
Font.default_italic = false



The boldface and italicized settings of your font are false by default.  But you can change them to true.  But they will typically be true throughout your game.

Code:
Font.default_color = Color.new(255,255,255,255)



Now this is entertaining.  You won't notice this because all of the Window class codes actively set the color of the font used, whether they call it 'system_color', 'normal_color' or 'knockout_color'.  But this would change the color of your font otherwise.


Up is down, left is right and sideways is straight ahead. - Cord "Circle of Iron", 1978 (written by Bruce Lee and James Coburn... really...)
[Image: QrnbKlx.jpg]
[Image: sGz1ErF.png] [Image: liM4ikn.png] [Image: fdzKgZA.png] [Image: sj0H81z.png]
[Image: QL7oRau.png] [Image: uSqjY09.png] [Image: GAA3qE9.png] [Image: 2Hmnx1G.png] [Image: BwtNdKw.png%5B]
Above are clickable links

Reply }


Messages In This Thread
TIPS AND TRICKS - by DerVVulfman - 07-05-2020, 05:11 PM
RE: TIPS AND TRICKS - by DerVVulfman - 07-05-2020, 06:26 PM
RE: TIPS AND TRICKS - by Melana - 07-05-2020, 10:36 PM
RE: TIPS AND TRICKS - by DerVVulfman - 07-16-2020, 06:12 AM
RE: TIPS AND TRICKS - by KDC - 08-08-2020, 08:11 AM
RE: TIPS AND TRICKS - by kyonides - 08-08-2020, 09:46 AM
RE: TIPS AND TRICKS - by KDC - 08-08-2020, 05:59 PM
RE: TIPS AND TRICKS - by DerVVulfman - 10-09-2020, 03:57 AM



Users browsing this thread: