Msypon Posted March 23, 2012 Share Posted March 23, 2012 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
arezu Posted March 24, 2012 Share Posted March 24, 2012 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
Msypon Posted March 24, 2012 Author Share Posted March 24, 2012 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
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