local screenWidth, screenHeight = guiGetScreenSize ( ) -- Get the screen resolution (width and height)
local myFont = nil
function createText ( )
local playerX, playerY, playerZ = getElementPosition ( localPlayer ) -- Get our player's coordinates.
local playerZoneName = getZoneName ( playerX, playerY, playerZ ) -- Get name of the zone the player is in.
myFont = dxCreateFont( "futurebq.ttf", 20 )
-- Draw zone name text's shadow.
if myFont then
dxDrawText (playerZoneName, 44, screenHeight - 41, screenWidth, screenHeight, tocolor ( 0, 0, 0, 255 ), 1.02, myFont )
-- Draw zone name text.
dxDrawText ( playerZoneName, 44, screenHeight - 43, screenWidth, screenHeight, tocolor ( 255, 255, 255, 255 ), 1, myFont )
else
dxDrawText ( "failed to import font", 44, screenHeight - 43, screenWidth, screenHeight, tocolor ( 255, 255, 255, 255 ), 1, "pricedown" )
end
end
function HandleTheRendering ( )
addEventHandler ( "onClientRender", root, createText ) -- keep the text visible with onClientRender.
end
addEventHandler ( "onClientResourceStart", resourceRoot, HandleTheRendering )
The "futurebq.ttf" is simply located at the same resource directory. Not sure why it isn't working. (myFont returns false)