Jump to content

How to put on center?


Msypon

Recommended Posts

How to put this text on center for all the resolutions?

sWidth, sHeight = guiGetScreenSize() 
    dxDrawText(text, sWidth-695,sHeight-395,sWidth-615,sHeight-366,tocolor(255,255,255,255),1.0,"bankgothic","center","top",false,false,false) 

Link to comment
local sWidth, sHeight = guiGetScreenSize() 
local scale = 1.0 
local font = "bankgothic" 
local textWidth = dxGetTextWidth(text, scale, font) 
local fontHeight = dxGetFontHeight(scale, font) 
  
dxDrawText(text, sWidth/2 - textWidth/2, sHeight/2 - fontHeight/2, sWidth, sHeight, tocolor(255, 255, 255, 255), scale, font) 

Link to comment
local sWidth, sHeight = guiGetScreenSize() 
local scale = 1.0 
local font = "bankgothic" 
local textWidth = dxGetTextWidth(text, scale, font) 
local fontHeight = dxGetFontHeight(scale, font) 
  
dxDrawText(text, sWidth/2 - textWidth/2, sHeight/2 - fontHeight/2, sWidth, sHeight, tocolor(255, 255, 255, 255), scale, font) 

Thank you alot dude :)

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...