Help Support the Baja Engine! Donate to Breezeway Studios!
Working with Text

Search:

Using text in your GUIs


First, you could convert your ttf font file that you want to use to render the text using fontmaker. Then, create a TextPanel.

Code

level.add{type='TextPanel',name='myTextPanel'}
obj.myTextPanel:font('myfont.lmf')
obj.myTextPanel:text('Hello World!')


Sample Implementation


The Techdemo includes a gui that uses text.

Editing lmf files in photoshop


Sometime you might want to make changes to the rendered bitmap inside the lmf font file. You can do that in Photoshop by following these instructions:

open as raw
channels count=1
channels depth=8 bits
header=5132 bytes
width/height gotten from output of fontmaker.exe. If you don't know them, they are powers of two, probably 256/512/1024.