Jump to content

Resolution problem


Castillo

Recommended Posts

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.

Link to comment

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 by Guest
Link to comment

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) ;)

Link to comment

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.

Link to comment
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

Link to comment

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.

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...