Unable to Change Font (compiler error)

Started by coolhotdogguy, Thu 06/08/2020 10:36:21

Previous topic - Next topic

coolhotdogguy

First off thank you,
I have been pulling my hair out trying to figure out what I am doing wrong. I am trying to change the font in my game (I already have one imported) So I look around and learn I need to use the code

static FontType Game.NormalFont = eFontMyFont;

in the global script.

But if I try to run the game i get the "Variable 'Game' is already defined" error message on this line of code. I cannot find where Game has already been defined. I just started this project so I know that I haven't defined it at least.

Thank you again!

EDIT: Thank you everyone! What I learned I needed to do was to put my code in the game.start function. (also didn't need static FontType)

Privateer Puddin'


zeta_san

Hello,
I try to help you
you imported the font
font menu -> right button -> new font?

Khris

The line at the top for each entry contains information about the data type, and whether the method/property is static or not.
The actual line looks different, and you can usually find example code near the end of the manual entry. As is the case here:

QuoteExample:

Game.NormalFont = eFontSpecial;

will change the normal font to the font "Special".

You're supposed to put this inside the  game_start  function btw, or you'll still get errors.

SMF spam blocked by CleanTalk