PiBoSo Official Forum

GP Bikes => Mods => Bikes => Topic started by: Manu on December 13, 2016, 01:54:22 PM

Title: Custom Fonts Tutorial (dashboard)
Post by: Manu on December 13, 2016, 01:54:22 PM
Custom Font Tutorial

Speed Font Example

Step 1: Create font string texture

Font String Color


Font String Alpha Channel


All characters must be exactly the same spaced in pixels (34 pixels in this example)
Save image as "speed_font.tga"

Step 2: Edit the "gfx.cfg" file:

In the "cockpit\gauges\lcd" section

speed
{
enable = 1
spacing = 34
font = speed_font.tga
fontstring = 0123456789
posx = 325
posy = 302
padding = 3
}


enable: 1(enable) 0(disable)
spacing: the size of one digit measured in pixels
font: the name of the font file
fontstring: the font string
posx: position of the font in the space (X axis) measured in pixels (in reference of "w_dash" texture)
posy: position of the font in the space (Y axis) measured in pixels (in reference of "w_dash" texture)
padding: the Quantity of digits are show in the dash

FINAL RESULT

https://www.youtube.com/v/xWOBCNPFtik
Title: Re: Custom Fonts Tutorial
Post by: Warlock on December 13, 2016, 02:24:21 PM
Thank you Manu, just want to add that in the font tga file all characters must be exactly the same spaced in pixels (very important) to show correctly in the dashboard
Title: Re: Custom Fonts Tutorial
Post by: Manu on December 13, 2016, 02:34:27 PM
Thanks Warlock, I add it to the tutorial.