guiCreateFont | Multi Theft Auto: Wiki Skip to content

guiCreateFont

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 GUI font element that can be used in guiSetFont. Successful font creation is not guaranteed, and may fail due to hardware or memory limitations.

Syntax

guiCreateFont ( )

Code Examples

client
-- Display a gui label
local myLabel = guiCreateLabel( 100, 300, 400, 50, "GUI label", false )
-- Use 'toggle' command to switch custom font on and off
addCommandHandler( "toggle",
function()
if not myFont then
myFont = guiCreateFont( "segoeui.ttf", 20 ) -- Create GUI custom font
guiSetFont( myLabel, myFont ) -- Apply font to a widget
else
destroyElement( myFont ) -- Destroy custom font
myFont = nil
end
end
)

See Also

GUI Functions