Setup

Requirements

Here's a list of the tested versions of GameMaker that works properly with GM-I18n.

PlatformIDERuntimeNotes
Windows VMv2024.13.1.193v2024.13.1.242All API works properly
Windows YYCv2024.13.1.193v2024.13.1.242All API works properly
HTML5v2024.13.1.193v2024.13.1.242Core API works properly, but there's an issue with the drawing functions

It should work on other versions of GameMaker 2.3+ too. Please let me know on the tested versions page if you tested it on other versions that not listed above, whether it works properly or not. It will help me and other users who want to know which versions of GameMaker that works properly with GM-I18n.


Installation

Importing Package

  1. Download the latest release from the releases page.
    Download
  2. Import the GM-I18n v<version>.yymps file to your project by dragging it to the IDE.
    Import
  3. Select the scI18n script from the list to import and click Add, or just click Add All. And finally, click the Import button.
    Ready

Types Definition Files (Optional)

There's some types definition files that you can use to help you understand better how to use the GM-I18n API. These files are Constants, Constructors, and Functions.

Think of it as a cheatsheet for GM-I18n documentation. It's not necessary to import it if you use the web documentation. But if you want to use it, you can follow the steps below:

  1. Same as step 3 in the Importing Package section, but this time import the Constants, Constructors, and Functions notes. So, you need to click the Add All button, instead of Add. And then click the Import button.
  2. Open your favorite code editor (such as Visual Studio Code, Lite XL, Atom, or other code editor you prefer).
  3. Create a .d.ts file (such as i18n.d.ts), or you can create 3 different files for each of them (i18n-constants.d.ts, i18n-constructors.d.ts, and i18n-functions.d.ts). You can create it anywhere you want, as long as you can open it with your code editor (besides the GameMaker IDE).
  4. Copy the content of the Constants, Constructors, and Functions notes to the .d.ts file you created. If you created 3 different files, you can copy the content of each note to each file.
  5. Save the file and you're done!
Types
Disclaimer:
The types definition files are not a real typescript definition. So, don't expect it to be fully functional.

Configuration

You can create your own fonts asset normally if the language you're using is a Latin-based language. But, if you're adding language with non-Latin characters, you need to follow the steps below:

Using Font Assets

  1. Create a new font asset in the IDE as you usually do.
  2. Click Add to add new range to the font asset for each character range you need. Set the from and to to the first and last character of the range. For example, if you're adding Japanese, you may add Higarana (12352 to 12447), Katakana (12448 to 12543), and Kanji (13312 to 19903).
    Font Asset
  3. Click Add Range after you done adding all the ranges you need.
  4. Repeat the steps above for each font you need.
You can find the character ranges for other languages here. Please note that the ranges are in decimal format, while the website shows it in hexadecimal. You can use an online converter to convert the hexadecimal to decimal.
Please also note that using too many ranges may cause the font asset to be too large, may cause performance issues, and may the characters won't be displayed correctly. So, try to use as few ranges as possible.

Using Included Files

  1. Prepare your font files. You can use any font you want, but make sure it's in .ttf or .otf format. You can convert any font to .ttf or .otf format using online converters.
  2. Click Menu button in the Asset Browser (that one with 3 stripes icon), and then click Included Files. The Included Files window will open, and then click Open in Explorer.
    Included Files
  3. A window will open and show you the datafiles folder of your project. Copy your font files there (with its license file). You can also make a folder for your font files, for example fonts.
    Copy Font Files
  4. In the Included Files window, click Refresh button. Your font files should now appear in the list.
  5. Create the font asset from code. Use the font_add() function to create the font asset. For example:
objController - Create Event
// font_add(name, size, bold, italic, first, last);
global.font_ja = font_add(working_directory + "fonts/NotoSansJP-Medium.ttf", 32, false, false, 32, 127);
If you're targetting to HTML5 export, don't use working_directory before the file path.
  1. Repeat step 5 for each font you need.
It's recommended to set it to a global variable (and delete it with font_delete() if you don't need it anymore). Pass the 32 to the first parameter, and 128 to the last parameter if you're not sure.
Please take note that using this method will load all glyphs in the font, so there is risk of a memory leak which will slow down and eventually crash your game.

  That's it, you're almost done to use the GM-I18n system!