Castillo Posted March 2, 2011 Posted March 2, 2011 Hi everyone, i'm having some problems with the DX drawing functions and the resolution, well, the problem is that i see them in right position, but the other players doesn't because they are using a lower resolution than mine. local sWidth,sHeight = guiGetScreenSize() dxDrawText("LEVEL:",sWidth-270, sHeight-1080/2, sWidth-292, sHeight-2/2,tocolor(255,255,0,255),1.5,"default","left","top",false,false,false) If someone could help me to make them work right for every resolution i would appreciate it. Thanks in advance.
Dre-+- Posted March 2, 2011 Posted March 2, 2011 (edited) i like this way: local sWidth,sHeight = guiGetScreenSize() local nW,nH = sWidth/1024,sHeight/768 dxDrawText("LEVEL:",sWidth-270*nW, sHeight-1080/2*nH, sWidth-292*nW, sHeight-2/2*nH,tocolor(255,255,0,255),1.5,"default","left","top",false,false,false) Edited March 2, 2011 by Guest
12p Posted March 2, 2011 Posted March 2, 2011 This is soo excesively simple... I cannot trust this local sWidth,sHeight = guiGetScreenSize() dxDrawText("LEVEL:",(754/1024)*sWidth, (228/768)*sHeight, (732/1024)*sWidth, sHeight, tocolor(255,255,0,255), (1024/sWidth)*1.5, "default","left","top",false,false,false) And I fixed scale too, may be too big text for "low-res" players (using about 1/2 of the screen isn't okay hahaha)
Castillo Posted March 2, 2011 Author Posted March 2, 2011 Thanks The Kid. Edit: It doesn't work, everything it's messed now
Castillo Posted March 4, 2011 Author Posted March 4, 2011 Could someone tell me how to fix this issue?
Xierra Posted March 4, 2011 Posted March 4, 2011 Solidsnake14, have you tried Remp's advice when I was asking the kind of resolution problem? I followed this, and actually, it worked on all resolutions as well! Look here: viewtopic.php?f=91&t=27886&p=312256&hilit=Alternate+HUD#p312299 I asked this long ago, when I was practicing and understanding about guiGetScreenSize and how it works. Remp solved my problem. Hope this fixes your issue too!
12p Posted March 4, 2011 Posted March 4, 2011 It won't solve it. Actually you didn't notice that he's doing the same code you mean: sWidth-270 LoL. Let me a moment, solidsnake. Looks like I gave my code wrongly hehehe :3 EDIT: Maybe this will work? I think the problem is that you have wrong the 2º "Y-Coord" argument. When I use this code, it works fine for me (I try in at least 2 res before keeping it going be). The only problem I noticed is that the scale was wrong but NOTHING IN MY FORMULA is wrong. local sWidth,sHeight = guiGetScreenSize() dxDrawText("LEVEL:",(754/1024)*sWidth, (228/768)*sHeight, (732/1024)*sWidth, (258/768)*sHeight, tocolor(255,255,0,255), (sWidth/1024)*1.5, "default","left","top",false,false,false) EDIT 2: If it still don't work, please try to change the coords before trying another method.
Castillo Posted March 4, 2011 Author Posted March 4, 2011 Sounds like that fixed the issue, thanks again The Kid.
CrazyDude Posted March 6, 2011 Posted March 6, 2011 Don't use "+" or "-" operation if you don't wan't problems :< Use "*" or "/" instead. Also, there is much easier method, try use something like this (middle of the screen): x=screenHeight*0.5 y=screenWidth*0.5 I think you got it
Castillo Posted March 6, 2011 Author Posted March 6, 2011 CrazyDude, the problem is already done by his way, no need to change again.
12p Posted March 7, 2011 Posted March 7, 2011 Don't use "+" or "-" operation if you don't wan't problems :< Use "*" or "/" instead.Also, there is much easier method, try use something like this (middle of the screen): x=screenHeight*0.5 y=screenWidth*0.5 I think you got it The good-math guys (and the people that takes less time doing something like this, with intelligence) will, of course, use "+" and "-". Positionating the DirectX that way takes about... 30 minutes? Mine takes just 5. PS: Check this link https://wiki.multitheftauto.com/wiki/ToRelative
Kenix Posted March 7, 2011 Posted March 7, 2011 Solidsnake14 , try to use to 0. ...... 0. ... at least from the pictures so works. example: GUIEditor_Image[81] = guiCreateStaticImage(0.740,0.770,0.250,0.250,"login/logo.png",true) I did not know if it works with the dx but at least all users, it will be the same size.
Castillo Posted March 7, 2011 Author Posted March 7, 2011 volk-rus, i already know that, but doesn't work with DX drawing P.S: I already said it's solved.
Kenix Posted March 7, 2011 Posted March 7, 2011 volk-rus, i already know that, but doesn't work with DX drawing P.S: I already said it's solved. ok man
CrazyDude Posted March 7, 2011 Posted March 7, 2011 CrazyDude, the problem is already done by his way, no need to change again. This was just small tip for feature developing
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