Jump to content

Resolution problem


Castillo

Recommended Posts

Posted

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.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

1024 * 768

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted (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 by Guest

Sorry for my bad english(

Posted

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

Posted

Thanks The Kid.

Edit: It doesn't work, everything it's messed now :?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Could someone tell me how to fix this issue?

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

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!

XX3 is gone. This is my new name. :3

Posted

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.

Posted

Sounds like that fixed the issue, thanks again The Kid.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

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

Posted

CrazyDude, the problem is already done by his way, no need to change again.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
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

Posted

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.

http://vk.com/the_kenix

Вопросы задавайте на форуме, не пишите мне в личку.

Please don't pm me.

Posted

volk-rus, i already know that, but doesn't work with DX drawing ;)

P.S: I already said it's solved.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
volk-rus, i already know that, but doesn't work with DX drawing ;)

P.S: I already said it's solved.

ok man :D

http://vk.com/the_kenix

Вопросы задавайте на форуме, не пишите мне в личку.

Please don't pm me.

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...