Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

How do I change the font?

This example would determine the way all the text messages / menu windows will be displayed.


Code:
class Font
  begin
    Font.default_name = "Times New Roman" # hab?a escogido Century Gothic 30
    Font.default_size = 20
    Font.default_bold = false
  end
end

If you need to change the font of a single window, you can enter this line of code inside any "def refresh" included in any script or wherever you find a self.contents.draw_text(0, 0, 100, 32, "your message", 0).

self.contents.font.size = 27
 
@The Sea King
Font.default_name = "Times New Roman"
Font.default_size = 20
Font.default_bold = false
Font.default_italic = false

The 1st one lets you choose the font name. It may be "Arial", "Verdana", etc. Just type the name as you can see it on Word, WordPerfect, OpenOffice.org, etc.

The 2nd one lets you define the size, a value between 8 and 32.

The 3rd one lets you choose if the font would use the "bold" feature or not. true means it will be used, false means it won't.

The 4th one lets you choose if the font would use the "italic" feature or not. true means it will be used, false means it won't.
 
Put them in Main.

HTML:
#==============================================================================
# ** Main
#------------------------------------------------------------------------------
#  After defining each class, actual processing begins here.
#==============================================================================

begin
   [b]Put the code here! After begin.[/b]
  # Prepare for transition
  Graphics.freeze
  # Make scene object (title screen)
  $scene = Scene_Title.new
  # Call main method as long as $scene is effective
  while $scene != nil
    $scene.main
  end
  # Fade out
  Graphics.transition(20)
rescue Errno::ENOENT
  # Supplement Errno::ENOENT exception
  # If unable to open file, display message and end
  filename = $!.message.sub("No such file or directory - ", "")
  print("Unable to find file #{filename}.")
end
 
please post any of the problematic scripts that doesn't show the text message. I'll try to check it out and fix the errors, unless someone else comes first and works on its correction...
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top