FuriouZ Posted May 21, 2013 Share Posted May 21, 2013 Hello all! I have question about resolution,that is here some easyer way to fix something eg: gui i have a gui GUIEditor.staticimage[1] = guiCreateStaticImage(0, 0, 800, 600, "img/backround.png", false) All buttons,labels etc are on image. Default resolution is 800x600,but i need that it is in same position in all resolutions i know that i can do it with local x, y = guiGetScreenSize() 800/800 = 1 600/600 = 1 But then i have to do it with all buttons etc and it is only waste of time ... so i ask,that is here some easyer way to fix gui position on all resolutions ? Link to comment
Jacob Lenn Posted May 21, 2013 Share Posted May 21, 2013 Or just do sth lile dat: 0.37x, 0.4y (37%x, 40%y). Your gui on other screens looking same like in urs. Link to comment
iPrestege Posted May 21, 2013 Share Posted May 21, 2013 Or just do sth lile dat: 0.37x, 0.4y (37%x, 40%y). Your gui on other screens looking same like in urs. I Think relative is better with gui element's . Link to comment
FuriouZ Posted May 23, 2013 Author Share Posted May 23, 2013 Well,i created a fast gui.. GUIEditor = { button = {}, window = {}, memo = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(547, 85, 249, 381, "TEST", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.memo[1] = guiCreateMemo(10, 24, 229, 320, "Just testing gui......", false, GUIEditor.window[1]) GUIEditor.button[1] = guiCreateButton(74, 344, 101, 27, "Close", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA") end ) I need that i doesn't have to calculate all gui elements in local x, y = guiGetScreenSize() Is it possible that i only calculate window and other elements on it changing automally or something.... ?? I say again i don't have good english. Link to comment
iPrestege Posted May 23, 2013 Share Posted May 23, 2013 is that so hard to understand what i said above ? After create the gui window .. button .. label ..etc Convert them to relative on the gui editor options . Link to comment
Dealman Posted May 23, 2013 Share Posted May 23, 2013 What Pres is saying is that while you have the GUI Editor open, you'll need to right-click each GUI Element such as a Window or Button and change it from Absolute to Relative. And then output your code and copy that. You'll see it uses a scale from 0-1 related to the parent element(I think) instead of X and Y co-ordinates. Link to comment
FuriouZ Posted May 23, 2013 Author Share Posted May 23, 2013 Okay,i got that,but as i sayd i am newibe in scripting,so i don't understand all what you're saying..also i am not good enough in english. Link to comment
iPrestege Posted May 23, 2013 Share Posted May 23, 2013 https://forum.multitheftauto.com/viewforum.php?f=117 Post your topic in your language section . Link to comment
FuriouZ Posted May 24, 2013 Author Share Posted May 24, 2013 https://forum.multitheftauto.com/viewforum.php?f=117Post your topic in your language section . There isn't my language. Link to comment
PaiN^ Posted May 25, 2013 Share Posted May 25, 2013 Change the 'false' argument in any element you created to 'true' . Link to comment
Blaawee Posted May 25, 2013 Share Posted May 25, 2013 What #Mr.Pres[T]ege want to tell you is to check the arg of your functions like : guiCreateWindow, guiCreateMemo and guiCreateButton . there is an argument called ' relative ' , like this one guiCreateWindow ( float x, float y, float width, float height, string titleBarText, bool relative ) Required Arguments: * x: A float of the 2D x position of the GUI window on a player's screen. This is affected by the relative argument. * y: A float of the 2D y position of the GUI window on a player's screen. This is affected by the relative argument. * width: A float of the width of the GUI window. This is affected by the relative argument. * height: A float of the height of the GUI window. This is affected by the relative argument. * titleBarText: A string of the text that will be displayed in the title bar of the window. * relative: This is whether sizes and positioning are relative. If this is true, then all x,y,width,height floats must be between 0 and 1, representing sizes/positions as a fraction of the screen size. If false, then the size and co-ordinates are based on client's resolution, accessible using guiGetScreenSize. Link to comment
FuriouZ Posted May 25, 2013 Author Share Posted May 25, 2013 Okay,i got that,but as i sayd i am newibe in scripting,so i don't understand all what you're saying..also i am not good enough in english. READ IT. Link to comment
iPrestege Posted May 25, 2013 Share Posted May 25, 2013 If you can't understand us what we have to do? Link to comment
FuriouZ Posted May 25, 2013 Author Share Posted May 25, 2013 C'mon why you don't reas what i sayd ? I sayd "I got it " = "I got it working or Works" Anyway thanks for the help. This topic going out of topic Link to comment
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