aintaro Posted April 9, 2014 Share Posted April 9, 2014 Hello guys, How would I write a simple dxdraw method where the font size is adjusted to the screen resolution? I know dxdraw has a optional scaleX and scaleY as arguments for the method but I just don't know how to write it. Thanks , aintaro Link to comment
Ali_Digitali Posted April 9, 2014 Share Posted April 9, 2014 You can get the screen width and hight with guiGetScreenSize. You can then use something like local screenWidth, screenHeight = guiGetScreenSize ( ) -- Get the screen resolution (width and height) local scale = screenHeight/10 function createText ( ) dxDrawText ("TEXT HERE",200,200,0, 0, tocolor ( 255, 255, 255, 255 ), scale, "pricedown" ) end function HandleTheRendering ( ) addEventHandler ( "onClientRender", root, createText ) end addEventHandler ( "onClientResourceStart", resourceRoot, HandleTheRendering ) Link to comment
aintaro Posted April 9, 2014 Author Share Posted April 9, 2014 Ok I got it, thanks man Link to comment
kevenvz Posted April 9, 2014 Share Posted April 9, 2014 For advanced scaling(how everyone uses it) local sX,sY = guiGetScreenSize() local Scale = sY/900 -- 900 is your screen height(1600x900) Link to comment
aintaro Posted April 9, 2014 Author Share Posted April 9, 2014 For advanced scaling(how everyone uses it) local sX,sY = guiGetScreenSize() local Scale = sY/900 -- 900 is your screen height(1600x900) Yeah thanks for letting me know, I did use it exactly like that 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