Best-Killer Posted December 16, 2016 Share Posted December 16, 2016 local screenW, screenH = guiGetScreenSize() local sx, sy = (screenW/1280), (screenH/768) function jobwindow() if isMouseSetColor (sx*505, sy*519, sx*76, sy*37) then coloracc = tocolor(0, 153, 0, 255) end if isMouseSetColor (sx*710, sy*519, sx*76, sy*37) then colordec = tocolor(255, 0, 0, 255) end dxSetAspectRatioAdjustmentEnabled( true ) dxDrawImage(sx*357, sy*161, sx*550, sy*450, imagepath, 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText("Accept", 505*sx, 519*sy, 76*sy, 37*sx, coloracc, 1.00*sx, newFont, "left", "top", false, false, false, false, false) dxDrawRectangle(sx*505, sy*519, sx*76, sy*37, tocolor(0, 0, 0, 0), false) dxDrawText("decline", sx*710, sy*519, sx*76, sy*37, colordec, 1.00*sx, newFont, "left", "top", false, false, false, false, false) dxDrawRectangle(sx*710, sy*519, sx*76, sy*37, tocolor(0, 0, 0, 0), false) coloracc = tocolor(255, 255, 255, 255) colordec = tocolor(255, 255, 255, 255) end the things for me fine but my freind have resolution 1920x1080 the text is not showing for him what is the problem ?? i can fix ? or players can't play with resolution 1920x1080 Link to comment
iPrestege Posted December 16, 2016 Share Posted December 16, 2016 (edited) It's all about the calculate this is an example to do it for all resolutions : dxDrawText("Accept", screenW*505/1280, screenH*519/768, screenW*76/1280, screenH*37/768, coloracc,screenH / 768 * 1.00 , newFont, "left", "top", false, false, false, false, false) Try this if it's working do it for all dx you are drawing. @Best-Killer Edited December 16, 2016 by iPrestege typo Link to comment
Best-Killer Posted December 16, 2016 Author Share Posted December 16, 2016 still same :v the text not showen :v Link to comment
iPrestege Posted December 16, 2016 Share Posted December 16, 2016 Post the new modified code. Also is there any errors? Can you see it ? not your friend you? Link to comment
Best-Killer Posted December 16, 2016 Author Share Posted December 16, 2016 function jobwindow() if isMouseSetColor (sx*505, sy*519, sx*76, sy*37) then coloracc = tocolor(0, 153, 0, 255) end if isMouseSetColor (sx*710, sy*519, sx*76, sy*37) then colordec = tocolor(255, 0, 0, 255) end dxSetAspectRatioAdjustmentEnabled( true ) dxDrawImage(sx*357, sy*161, sx*550, sy*450, imagepath, 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText("Accept", screenW*505/1280, screenH*519/768, screenW*76/1280, screenH*37/768, coloracc,screenH / 768 * 1.00 , newFont, "left", "top", false, false, false, false, false) dxDrawRectangle(sx*505, sy*519, sx*76, sy*37, tocolor(0, 0, 0, 0), false) dxDrawText("decline", sx*710, sy*519, sx*76, sy*37, colordec, 1.00*sx, newFont, "left", "top", false, false, false, false, false) dxDrawRectangle(sx*710, sy*519, sx*76, sy*37, tocolor(0, 0, 0, 0), false) coloracc = tocolor(255, 255, 255, 255) colordec = tocolor(255, 255, 255, 255) end i just add your code dude :v Errors : No me or my friend : i can see the texts but my friend no Link to comment
iPrestege Posted December 16, 2016 Share Posted December 16, 2016 Hmmm that's worried i'm always using this method and it's working with me fine but not sure about 1920*1080 resolution so maybe someone can give a hand to see how it's working in that high resolution are you sure your friend can't see ' Accept ' text? Link to comment
Best-Killer Posted December 16, 2016 Author Share Posted December 16, 2016 Yes i'm sure bro :v i'm not sure about 1920x1080 resolution too :v Link to comment
koragg Posted December 17, 2016 Share Posted December 17, 2016 (edited) @Best-Killer follow this example and it'll work for sure. I also tried with the way you're trying and i couldn't see the text i wanted to fix until i used the method with the floating point numbers (I'm on 1920x1080 btw). Edited December 17, 2016 by koragg Link to comment
Best-Killer Posted December 18, 2016 Author Share Posted December 18, 2016 guys i tried with 2 ways : 1- local sWidth,sHeight = guiGetScreenSize() dxDrawText("accept",(505/1280)*sWidth, (519/768)*sHeight, (76/1280)*sWidth, (37/768)*sHeight, coloracc, (1280/sWidth)*1.00, newFont,"left","top",false,false,false) 2- screenWidth, screenHeight = guiGetScreenSize() scaleX = screenWidth/1280 scaleY = screenHeight/768 dxDrawText( "Accept" ,505*scaleX, 519*scaleY, 76*scaleX, 37*scaleY, coloracc, scaleX*1.00, newFont,"left","top",false,false,false) and same problem dude :v any help ? Note : 0 errors Link to comment
koragg Posted December 19, 2016 Share Posted December 19, 2016 Floating point number = 0.12345 etc. Try doing those calculations and replacing the values with screenW*float and screenH*float. I'll try fix it for you once i get on my pc but try yourself first with the way i described. Link to comment
koragg Posted December 19, 2016 Share Posted December 19, 2016 (edited) Try this, I can't really test but this is the way I make all my dxDrawText show ok on any screen. local x, y = guiGetScreenSize() local sx, sy = x/1440, y/900 local coloracc local colordec function jobwindow() if isMouseSetColor (x*0.26302083, y*0.48056, x*0.039583, y*0.03425926) then coloracc = tocolor(0, 153, 0, 255) end if isMouseSetColor (x*0.36979167, y*0.48056, x*0.039583, y*0.03425926) then colordec = tocolor(255, 0, 0, 255) end dxSetAspectRatioAdjustmentEnabled(true) dxDrawImage(x*0.1859375, y*0.14907407, x*0.2864583, y*0.4167, imagepath, 0, 0, 0, tocolor(255, 255, 255, 255), false) dxDrawText("Accept", x*0.26302083, y*0.48056, x*0.039583, y*0.03426, coloracc, 1*sy, newFont, "left", "top", false, false, false, false, false) dxDrawRectangle(x*0.26302083, y*0.48056, x*0.039583, y*0.03426, tocolor(0, 0, 0, 0), false) dxDrawText("Decline", x*0.36979167, y*0.48056, x*0.039583, y*0.03426, colordec, 1*sy, newFont, "left", "top", false, false, false, false, false) dxDrawRectangle(x*0.36979167, y*0.48056, x*0.039583, y*0.03426, tocolor(0, 0, 0, 0), false) coloracc = tocolor(255, 255, 255, 255) colordec = tocolor(255, 255, 255, 255) end EDIT: Your code can work too I think but you've made a mistake in the text size. 1.00*sx should be 1.00*sy in lines 9 and 11 of your first post's code. Edited December 19, 2016 by koragg Link to comment
Best-Killer Posted December 20, 2016 Author Share Posted December 20, 2016 (edited) about 1.00*sy you're right but your code not work and my not work too wtf any pro dxdraw text help or any others help pls #koragg thx for your try bro Edited December 20, 2016 by Best-Killer Link to comment
koragg Posted December 20, 2016 Share Posted December 20, 2016 (edited) 7 hours ago, Best-Killer said: about 1.00*sy you're right but your code not work and my not work too wtf any pro dxdraw text help or any others help pls #koragg thx for your try bro Make the positions of everything look ok for YOUR resolution only (just numbers, no multiplications). Then post your code and say on what resolution you've made it. I'll take a look then and try to fix it for any screen. Btw what's that "isMouseSetColor" thing? I can't find it on the wiki. Edited December 20, 2016 by koragg Link to comment
1LoL1 Posted December 23, 2016 Share Posted December 23, 2016 (edited) On 20. 12. 2016 at 9:21 AM, koragg said: Make the positions of everything look ok for YOUR resolution only (just numbers, no multiplications). Then post your code and say on what resolution you've made it. I'll take a look then and try to fix it for any screen. Btw what's that "isMouseSetColor" thing? I can't find it on the wiki. I think it's isMouseInPosition Edited December 23, 2016 by 1LoL1 Link to comment
N3xT Posted December 23, 2016 Share Posted December 23, 2016 Try that, and change ( 1366, 768 ) to your screen resolution local nW,nH = guiGetScreenSize() local x, y = nW/1366,nH/768 addEventHandler("onClientRender",root, function () dxDrawText("MTA Forum", x*680, y*464, x*811, y*490, tocolor(255, 255, 255, 255), 2, "default-bold", "center", "center", false, false, true, false, false) end ) 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