Jump to content

Dxdraw Question


aintaro

Recommended Posts

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...