Blinker. Posted June 11, 2014 Share Posted June 11, 2014 hello , i've been working on how to make a text appear same at all resolutions and didn't get a result if anyone could help me with that i would appreciate it. function drawText() local width1 = dxGetTextWidth(hexColorHome..homeName.."("..homeAlivePlayers..") ".."#ffffff "..displayHome, 1, 'default-bold') local width2 = dxGetTextWidth(hexColorVisit..visitName.."("..visitAlivePlayers..") ".."#ffffff "..displayVisit, 1, 'default-bold') width = width1 if width < width2 then width = width2 end local x = sW - 42 - width dxDrawRectangle(x + 68,(sH/1.85)-50,width - 40,40, tocolor(0,0,0,120)) dxDrawText ( hexColorHome..homeName.."("..homeAlivePlayers..") ".."#ffffff "..displayHome, x + 72, (sH/2.21)+5, x + width, sH, tocolor(255, 102, 1, 255), 1, "default-bold", 'left', 'top', false, false, false, true, true, 0, 0, 0) dxDrawText ( hexColorVisit..visitName.."("..visitAlivePlayers..") ".."#ffffff "..displayVisit, x + 72, (sH/2.05)+5, x + width, sH, tocolor(255, 0, 0, 255), 1, "default-bold", 'left', 'top', false, false, false, true, true, 0, 0, 0) end addEventHandler("onClientRender", root, drawText) well , i tried it on 800x600 it works good, the text is in the rectangle but when i tried a lower or higher resolution i got a trouble the text isn't in the rectangle please help. thanks in advance Link to comment
#DRAGON!FIRE Posted June 11, 2014 Share Posted June 11, 2014 if u try to all Screen dxText .. u must edit position some edits to be good Link to comment
Blinker. Posted June 12, 2014 Author Share Posted June 12, 2014 Isn't there a way to make it appear same on all ? Link to comment
xXMADEXx Posted June 12, 2014 Share Posted June 12, 2014 You can do it by basic math, but other than that, there isn't a way. Link to comment
Blinker. Posted June 12, 2014 Author Share Posted June 12, 2014 can you please help me with it ? i tried a lot .. i want to put that text into the rectangle , the rectangle is centered on all resolutions but the text isn't , only works on 800x600 Link to comment
xXMADEXx Posted June 12, 2014 Share Posted June 12, 2014 You could do something like this: local sx, sy = guiGetScreenSize ( ) local fontSize = ( ( sx / 1280 ) + ( sy / 960 ) ) * 1.2 Link to comment
Blinker. Posted June 12, 2014 Author Share Posted June 12, 2014 well , that fixed it to center on all resolution to the left , i need it to the right thanks Link to comment
#DRAGON!FIRE Posted June 12, 2014 Share Posted June 12, 2014 try this .. on dxText You do not have to edit .. try : local sX, sY = guiGetScreenSize( ) local Px = ( sX/800 )*PosX local Py = ( sY/600 )*PosY Link to comment
Blinker. Posted June 12, 2014 Author Share Posted June 12, 2014 try this .. on dxText You do not have to edit .. try : local sX, sY = guiGetScreenSize( ) local Px = ( sX/800 )*PosX local Py = ( sY/600 )*PosY can you please edit on the script i gave , i got nothing when i add this to mine.. thanks. 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