JoZeFSvK Posted June 21, 2013 Share Posted June 21, 2013 Hey i have problem with positions i see this [h1]When my friend connect he see it [/h1] When will problem ? We must edit only text position. local x,y = guiGetScreenSize() --------- POINTY DRAW TEXT ------------------ dxDrawText(pointsCL, x-670, 739, x-100, y, tocolor(255,255,255,255), 1, "default-bold", "left", "top",false,false,true ) ------------- CASH DRAW TEXT------------ dxDrawText(cashCL, x-738, 739, x-100, y, tocolor(255,255,255,255), 1, "default-bold", "left", "top",false,false,true ) and background local screenWidth,screenHeight = guiGetScreenSize() dxDrawImageSection (261, screenHeight - 37, 64, 32, 195, 37, 64, 32, myFile)--Cash bg dxDrawImageSection (325, screenHeight - 37, 64, 32, 131, 37, 64, 32, myFile)--Points bg How to make that all players it see in img bg ? Thank you for your answers. Link to comment
HunT Posted June 21, 2013 Share Posted June 21, 2013 Can u use GUI elements with relative position. Player enter in the vehicle/ onClientRender guiSetText Player exit in the vehicle / remove event guiSetVisible false Link to comment
JoZeFSvK Posted June 21, 2013 Author Share Posted June 21, 2013 what have jointly Player enter/exit in the vehicle with text position ... problem is in screen resolution Link to comment
HunT Posted June 21, 2013 Share Posted June 21, 2013 Well , if u not understand my example is not my problem Enter and Exit in the vehicle is only for render. Now I can't make the script example (reply with iPhone) Link to comment
xXMADEXx Posted June 21, 2013 Share Posted June 21, 2013 Its because your only creating it for your resolution. You need to use math to make it in the same place for all reses Link to comment
denny199 Posted June 21, 2013 Share Posted June 21, 2013 A quote from me: https://wiki.multitheftauto.com/wiki/GuiGetScreenSize There are some calculations there 2. Divide each of the DX text's position values by the screen size manually (remembering the resolution is 1024x768): Left position value is 684, 684/1024 = 0.668 Top position value is 731, 731/768 = 0.952 Right position values is 732, 732/1024 = 0.715 Bottom position value is 766, 766/768 = 0.997 You may want to use a calculator to help you count. 3. Now with the answer above remove all of the position values and replace it with the width or height variable multiplied by the answer. Which would be: local sWidth,sHeight = guiGetScreenSize() -- The variables dxDrawText("Hello World!",sWidth*0.668, sHeight*0.952, sWidth*0.715, sHeight*0.997,tocolor(0,255,255,175),1.0,"bankgothic","left","top",false,false,false) ------------------------------MY EXAMPLE---------------------------------------------- So if you look at "2." then you need to calculate it like this: calc1 = Left position value / my local screenx = answer for all screen for next calculation screenX calc2 = Top position value / my local screeny = answer for all screen for next calculation screenY calc3 = Right position value/ my local screenx = answer for all screen for next calculation width calc4 = Bottom position value/ my local screeny = answer for all screen for next calculation height So after that you can use it like this: local sX,sY = guiGetScreenSize() sX*calc1, sY*calc2, sX*calc3, sY*calc4 This will be on all the resolutions the same. I hope that I helped you. Kindly regards, Danny 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