dxCreateFont | Multi Theft Auto: Wiki Skip to content

dxCreateFont

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function creates a DX font element that can be used in dxDrawText. Successful font creation is not guaranteed, and may fail due to hardware or memory limitations.

Note

The size can't be less than 5 or more than 150. Use this function after onClientResourceStart, otherwise some characters may be displayed incorrectly.

Syntax

dxCreateFont ( )

Code Examples

client
local font = dxCreateFont('myfont.ttf', 20, false, 'proof') or 'default' -- fallback to default
addEventHandler('onClientRender', root, function()
dxDrawText('Example Text', 100, 350, 300, 350, tocolor(255, 255, 0), 1, font)
end)