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.

[Help Me] I cant get my script working like it should

I think I have the script setup right. It does what its supposed to do but I want people to be able to change the Font and Size mid game using
Code:
$game_system.font = "Arial" or $game_system.size = 22

It works for the most part when you set the default font in the script but when I try to use the syntaxes it doesnt change anything. Here's my script.
Code:
class Game_System

  attr_accessor :font                    # font

  attr_accessor :size                    # size

  alias re_init initialize

  def initialize

    @font = "Arial"

    @size = 20

    re_init

  end

end

 

class Font

  alias change_font initialize

  def initialize

    change_font

    self.name = $game_system.font

    self.size = $game_system.size

  end

end
 

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