..:D&G:.. Posted January 22, 2014 Posted January 22, 2014 How can I set the a custom font for a dxDrawText? dxDrawText( title, x, 0, x + width, y + 18, tocolor( tcolor[1], tcolor[2], tcolor[3], tcolor[4] * alpha ), 0.6, "bankgothic", "left", "top", true, true, true ) MTA:Rust Pre-Alpha Build v.0.3: https://forum.mtasa.com/viewtopic.php?f=114&t=97848 2Pac: ''Only God can judge me!''
Karuzo Posted January 22, 2014 Posted January 22, 2014 Just replace "bankgothic" with your fontname. Dont forget to define it .
..:D&G:.. Posted January 22, 2014 Author Posted January 22, 2014 Didn't work, but it did when I did this: local font = dxCreateFont("font.ttf") MTA:Rust Pre-Alpha Build v.0.3: https://forum.mtasa.com/viewtopic.php?f=114&t=97848 2Pac: ''Only God can judge me!''
Moderators IIYAMA Posted January 22, 2014 Moderators Posted January 22, 2014 local font = dxCreateFont("font.ttf") ----------- dxDrawText( title, x, 0, x + width, y + 18, tocolor( tcolor[1], tcolor[2], tcolor[3], tcolor[4] * alpha ), 0.6, font, "left", "top", true, true, true ) Also make sure, the file is written in the meta.xml Do you want to improve your Lua programming skills and make less mistakes? Start with Lua Language Server! Useful functions 3x Spoiler checkPassiveTimer getScreenStartPositionFromBox getPedGender Tutorials 4x Spoiler Scaling DX Events Attach an addEventHandler on a group of elements Debugging
ViRuZGamiing Posted January 22, 2014 Posted January 22, 2014 indeed "font.ttf"/> -- if i'm correct You can also use a folder: "fonts/font.ttf"/> The folder is also required in the script's line dxCreateFont! "If debugging is the process of removing software bugs, then programming must be the process of putting them in."
..:D&G:.. Posted January 23, 2014 Author Posted January 23, 2014 I said it worked, but thx anyway I only posted the last reply if someone might have the same problem and look at this for a solving. MTA:Rust Pre-Alpha Build v.0.3: https://forum.mtasa.com/viewtopic.php?f=114&t=97848 2Pac: ''Only God can judge me!''
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now