SkatCh Posted June 11, 2014 Posted June 11, 2014 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
..:D&G:.. Posted June 11, 2014 Posted June 11, 2014 You can use this... guiGetScreenSize MTA:Rust Pre-Alpha Build v.0.3: https://forum.mtasa.com/viewtopic.php?f=114&t=97848 2Pac: ''Only God can judge me!''
Max+ Posted June 11, 2014 Posted June 11, 2014 [quote name=..&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
SkatCh Posted June 11, 2014 Author Posted June 11, 2014 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
Den. Posted June 11, 2014 Posted June 11, 2014 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
..:D&G:.. Posted June 11, 2014 Posted June 11, 2014 As I said, use guiGetScreenSize You will have to play around with the possitions, so you get the right possition of the gui MTA:Rust Pre-Alpha Build v.0.3: https://forum.mtasa.com/viewtopic.php?f=114&t=97848 2Pac: ''Only God can judge me!''
Moderators Citizen Posted June 11, 2014 Moderators Posted June 11, 2014 No, just use relative positions and sizes for all of your gui elements. 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 ...
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