aintaro Posted April 9, 2014 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 None of us is as smart as all of us.
Ali_Digitali Posted April 9, 2014 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 ) I aint got no time to think of a witty signature
aintaro Posted April 9, 2014 Author Posted April 9, 2014 Ok I got it, thanks man None of us is as smart as all of us.
kevenvz Posted April 9, 2014 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)
aintaro Posted April 9, 2014 Author 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 None of us is as smart as all of us.
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