Jump to content

Screen resolution


SkatCh

Recommended Posts

Posted

hi guys please how can i keep the same Gui Dimension , in evry resoultion , because my friend can't see some gui in my server .

thank you and i am sorry about my english .

Failure is simply an opportunity to begin again more intelligently - Henry Ford

Posted

[quote name=..:D&G:..]You can use this...

guiGetScreenSize  

He mean he has a resolution like 800-600 and they have 1366 - 768 who he can the gui work on both of them ,

- New , Kill System

- New, GameMode Intro

- Leve / Exp System

- New nametag showing style

- New , Hud For Players

- Skin Selection from SA-MP

- Money System / Buy Weapons

- Drop Weapons

- New, Flood System

- New , Group Assign

- Gun license For Weapons

- Random Rule System For Money

Posted

He mean he has a resolution like 800-600 and they have 1366 - 768 who he can the gui work on both of them ,

yes exactly , i create a Gui in my resolution which is 1366 - 768 , then when my friend login he can't see it in the same place like me .

Failure is simply an opportunity to begin again more intelligently - Henry Ford

Posted

Use relative values, and guiGetScreenSize as D&G suggested:

local sx, sy = guiGetScreenSize() 
local width, height = 0.5 * sx, 0.5 * sy 
local x, y = (0.5 * sx) - width/2, (0.5 * sy) - height/2 

  • Moderators
Posted

No, just use relative positions and sizes for all of your gui elements.

:arrow: What's the difference between relative and absolute ?

The absolute positions and sizes are using pixels of the screen. So if you place a gui at position (960;50) and the player has a 800*600 screen display, then the gui will be placed too much on the right, litterally out of the screen.

But relative positions and sizes uses percentages of the current screen (0 = 0% , 0.5 = 50% and 1 = 100%). So it doesn't even care of the number of pixels the current screen has. 50% of your screen will be 50% on every other screens.

If you are using the guieditor resource (which I recommend), you can tell it to use relative or absolute values, so make sure everything is set on relative values (there are 2 of them, one for the parent (guis that are directly drawn on the screen) and children (guis that has another gui as parent).

If you don't want to recreate your entire gui, then drop your code here, tell me what resolution you were using while making it and I'll convert it for you.

Regards,

Citizen

The rEvolution is coming ...

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