Zinjaaa Posted July 18, 2013 Share Posted July 18, 2013 How I can add text of this information panel? Besides I want a call letter font (Impact). I really really appreciate it if you guys teach me ¿Cómo puedo añadir texto de este panel de información? Además quiero un tipo de letra llamada (Impacto). Yo realmente apreciaría si ustedes me enseñan --------------------------------> http://tinypic.com/view.php?pic=15p5xyu&s=5 <-------------------------------- Link to comment
Jaysds1 Posted July 19, 2013 Share Posted July 19, 2013 dxCreateFont -- creates custom font dxDrawText --draw text Link to comment
[N]irvana Posted July 19, 2013 Share Posted July 19, 2013 (edited) dxCreateFont -- creates custom font dxDrawText --draw text You can write an example? not guided me a lot with the examples of the wiki. Edited July 19, 2013 by Guest Link to comment
Jaysds1 Posted July 19, 2013 Share Posted July 19, 2013 ok, Wiki Example: local myFont = nil -- Display text using dxDrawText addEventHandler( "onClientRender", root, function() if myFont then dxDrawText( "dxDrawText", 100, 350, 300, 350, tocolor(255,255,0), 1, myFont ) end end ) -- Use 'toggle' command to switch custom font on and off addCommandHandler( "toggle", function() if not myFont then myFont = dxCreateFont( "segoeui.ttf", 20 ) -- Create custom font else destroyElement( myFont ) -- Destroy custom font myFont = nil end end ) Link to comment
[N]irvana Posted July 19, 2013 Share Posted July 19, 2013 I mean that you make an example, not that bring out the wikipedia please. Link to comment
Jaysds1 Posted July 19, 2013 Share Posted July 19, 2013 (edited) Wow, ok local sw,sh = guiGetScreenSize() local font = dxCreateFont("impact.ttf") --creates font --creates a text using the customed font in the middle of the screen dxDrawText( "THIS IS MY NEW FONT!!!", sw/2 - 200, sh/2 - 200, 200, 200, tocolor(0,255,0), 1, font ) Edited July 19, 2013 by Guest Link to comment
[N]irvana Posted July 19, 2013 Share Posted July 19, 2013 This does not work. help me local isPlayerViewingImage = false; local sx, sy = guiGetScreenSize ( ) function dxDrawTheImage ( ) if ( isPlayerViewingImage ) then dxDrawImage ( 240, 145, 550, 480, "window.png" ) end end bindKey("f9", "down", function() addEventHandler ( "onClientRender", root, dxDrawTheImage ) isPlayerViewingImage = not isPlayerViewingImage end ) local sw,sh = guiGetScreenSize() local font = dxCreateFont("impact.ttf",) --creates font --creates a text using the customed font in the middle of the screen dxDrawText( "THIS IS MY NEW FONT!!!", sw/2 - 1024, sh/2 - 768, 175, 80, tocolor(255,255,255), 1, myFont ) Link to comment
Jaysds1 Posted July 19, 2013 Share Posted July 19, 2013 This should work: local isPlayerViewingPanel = false local sw,sh = guiGetScreenSize() local font = dxCreateFont("impact.ttf") --creates font function dxDrawTheImage ( ) if isPlayerViewingPanel then dxDrawImage ( 240, 145, 550, 480, "window.png" ) dxDrawText( "THIS IS MY NEW FONT!!!", sw/2 - 1024, sh/2 - 768, 175, 80, tocolor(255,255,255), 1, font ) end end addEventHandler ( "onClientRender", root, dxDrawTheImage ) bindKey("f9", "down",function() isPlayerViewingPanel = not isPlayerViewingPanel end) and make sure you have the font in the same folder as this script!!! Link to comment
[N]irvana Posted July 19, 2013 Share Posted July 19, 2013 Well Thanks for your great help, but it still does not work. Link to comment
Jaysds1 Posted July 19, 2013 Share Posted July 19, 2013 make sure you have the font in the same folder as this script!!!And make sure the image.png is there too!!! local isPlayerViewingPanel = false local sw,sh = guiGetScreenSize() local font = dxCreateFont("impact.ttf") --creates font function dxDrawTheImage ( ) if isPlayerViewingPanel then dxDrawImage (240, 145, 550, 480, "window.png" ) dxDrawText( "THIS IS MY NEW FONT!!!", sw/2 - 1024, sh/2 - 768, sw/2 + 175, sh/2 + 80, tocolor(255,255,255), 1, font ) end end addEventHandler ( "onClientRender", root, dxDrawTheImage ) bindKey("f9", "down",function() isPlayerViewingPanel = not isPlayerViewingPanel end) Try this and if it doens't work please describe what's not working! Link to comment
[N]irvana Posted July 19, 2013 Share Posted July 19, 2013 Thank you friend, now this does the job, I realized that the coordinates were far from the panel, but I served Thanks for your help. Link to comment
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