Author Topic: Custom Fonts Tutorial (dashboard)  (Read 555 times)

Manu

  • Hero Member
  • *****
  • Posts: 592
    • View Profile
Custom Fonts Tutorial (dashboard)
« 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
Code: [Select]
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

<a href="https://www.youtube.com/v/xWOBCNPFtik" target="_blank" class="new_win">https://www.youtube.com/v/xWOBCNPFtik</a>
« Last Edit: December 15, 2016, 12:09:55 PM by Manu »

Warlock

  • Hero Member
  • *****
  • Posts: 1088
    • View Profile
Re: Custom Fonts Tutorial
« Reply #1 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

Manu

  • Hero Member
  • *****
  • Posts: 592
    • View Profile
Re: Custom Fonts Tutorial
« Reply #2 on: December 13, 2016, 02:34:27 PM »
Thanks Warlock, I add it to the tutorial.