Skip to content
Thomas edited this page Dec 24, 2019 · 3 revisions

Font

uiZ has a few ways it handles fonts that may be useful for you to know.
uiZ uses the freeware M+ 2p font family included: https://www.fontspace.com/m-fonts/m-2p

General use of fonts in objects

Many objects have a "font" parameter available. By default on most objects, this value is -1.
A value of -1 means that there will be no font change and whatever font was last loaded is used for drawing. You can pass any game maker font to these values. I recommend picking a uiz_fnt_dp_XX font listed below.

DP font

uiZ has the following fonts pre-compiled:

  • uiz_fnt_2: M+ 2p regular @size 2px
  • uiz_fnt_5: M+ 2p regular @size 5px
  • uiz_fnt_8: M+ 2p regular @size 8px
  • uiz_fnt_10: M+ 2p regular @size 10px
  • uiz_fnt_20: M+ 2p regular @size 20px
  • uiz_fnt_30: M+ 2p regular @size 30px
  • uiz_fnt_50: M+ 2p regular @size 50px
  • uiz_fnt_70: M+ 2p regular @size 70px

Use of the above fonts is discouraged, because pixel based fonts don't scale well between different display resolutions.

At the start of your game/program, uiZ will load the following fonts:

  • uiz_fnt_dp_15: M+ 2p regular @size 0.15 density pixels
  • {disabled by default} uiz_fnt_dp_30: M+ 2p regular @size 0.30 density pixels
  • {disabled by default} uiz_fnt_dp_50: M+ 2p regular @size 0.50 density pixels

A DP based font appears to be the same size on a desktop vs a phone, while also taking resolution into account. A dp of 1 is equal to a height of 1 inch in real life. A dp of 0.15 density pixels is equal to 0.15 inch (=3,81 mm) in real life.
To enabled disabled fonts, please edit UIZ_FONT. These are disabled to prevent performance hits on mobile devices of which the developer (you) is not aware.

Character sets

When your game is loading uiz tries to match the uiz_fnt_dp_XX to any of the uiz_fnt_XX. The pixel fonts are pre-generated, which is faster and doesn't load an extra texture page.
uiZ handles a character set from unicode 32 to unicode 255. This captures the most important Latin alphabets. Should your game require slavic or eastern characters, you will have to change this range.
To do this change the following files:

  • uiz_fnt_XX (In the Fonts section of the GM resource tree) (static generated fonts)
  • UIZ_FONT_IMPORT (A subtab of UIZ_FONT) (loaded if the static fonts don't suffice)

Your own fonts

In a game, a special or custom font is very common. To use your font with uiZ you need to edit the following files:

  • uiz_fnt_XX (In the Fonts section of the GM resource tree) (static generated fonts)
  • UIZ_FONT_IMPORT (A subtab of UIZ_FONT) (loaded if the static fonts don't suffice)

Wiki pages

🏑Home / General
πŸ“ƒTutorials
πŸ‘ͺ Parent
↕️ Positioning
πŸ›  Fixing & Updating
πŸ• Depth
πŸ“ƒ Templates and Examples
πŸŒ† Background
πŸ“‡ Structures
🎈 Objects

obj_uiZ_3waybutton
obj_uiZ_button
obj_uiZ_checkbox
obj_uiZ_clock
obj_uiZ_colorbox
obj_uiZ_cover
obj_uiZ_drawdslist obj_uiZ_dropdown
obj_uiZ_easybutton
obj_uiZ_frame
obj_uiZ_framescrollbar
obj_uiZ_functionbar
obj_uiZ_gradientsquare
obj_uiZ_gradientroundrect
obj_uiZ_gridlist
obj_uiZ_huesquare
obj_uiZ_loadingbar
obj_uiZ_loadingcircle
obj_uiZ_menubutton
obj_uiZ_mousemenu
obj_uiZ_radiobox
obj_uiZ_rotator
obj_uiZ_slider
obj_uiZ_scrollbar
obj_uiZ_slider_2col
obj_uiZ_slickslider
obj_uiZ_slideframe
obj_uiZ_sprbutton
obj_uiZ_spriteanimationbutton
obj_uiZ_spritecounter
obj_uiZ_stringbox
obj_uiZ_sliderstruct
obj_uiZ_surfacecanvas
obj_uiZ_sprite
obj_uiZ_square
obj_uiZ_squarebutton
obj_uiZ_swipicon
obj_uiZ_switch
obj_uiZ_tabslider
obj_uiZ_tabs
obj_uiZ_treelist
obj_uiZ_text
obj_uiZ_text_background
obj_uiZ_textarea
obj_uiZ_valuebox


🎈 Your own objects
🚫 Destroy
🐭 Mouse
πŸ’» Windows (uiz)
🌌 Animations
❓ General
πŸ“’ Numbers
πŸ“’ Strings
✏️ Draw
🚩 Popup
πŸ“‚ Files
πŸ’» Windows (os)
Clone this wiki locally