• Welcome to PiBoSo Official Forum. Please login or sign up.
 
December 09, 2024, 06:50:57 AM

News:

World Racing Series beta14 available! :)


Custom Fonts Tutorial (dashboard)

Started by Manu, December 13, 2016, 01:54:22 PM

Previous topic - Next topic

Manu

December 13, 2016, 01:54:22 PM Last Edit: December 15, 2016, 12:09:55 PM by Manu
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
It's Easier to Fool People Than It Is to Convince Them That They Have Been Fooled.

Warlock

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

Manu

Thanks Warlock, I add it to the tutorial.
It's Easier to Fool People Than It Is to Convince Them That They Have Been Fooled.