LiOneLMeSsIShoT Posted December 5, 2013 Share Posted December 5, 2013 I've made gui windows in my server...and i got a problem with "Resolution"...because the Resoltion which i use it:1280 x 720: so the others don't see the guis with the correct Resolution..it makes problems on my server.. so there's someway to make the Resolution of Guis Automatic? or even when the player join set his Resolution to 1280 x 720? Please help guys. Thanks Link to comment
myonlake Posted December 5, 2013 Share Posted December 5, 2013 Use relative positioning to fix this issue. Link to comment
LiOneLMeSsIShoT Posted December 5, 2013 Author Share Posted December 5, 2013 Use relative positioning to fix this issue. hmm..how to use it? can you give me an example? Link to comment
myonlake Posted December 5, 2013 Share Posted December 5, 2013 https://wiki.multitheftauto.com/wiki/In ... ng_the_GUI Link to comment
LiOneLMeSsIShoT Posted December 6, 2013 Author Share Posted December 6, 2013 https://wiki.multitheftauto.com/wiki/Introduction_to_Scripting_the_GUI I want this to Defin automatic...because if i Define then the window will work with one Resoultion..or what? -- define the X and Y positions of the window local X = 0.375 local Y = 0.375 -- define the width and height of the window local Width = 0.25 local Height = 0.25 And Actually still don't understand ..because that gui you gave me learns to make a gui to make login panel..i want a script to make the resolution automatic work fine. Link to comment
WASSIm. Posted December 6, 2013 Share Posted December 6, 2013 u can use this to make your window center CenterWindow Link to comment
myonlake Posted December 6, 2013 Share Posted December 6, 2013 Let me quote from the Wiki page that you said you read. Relative and AbsoluteNote that the final argument passed to guiCreateWindow in the above example is true. This indicates that the coordinates and dimensions of the window are relative, meaning they are a percentage of the total screen size. This means that if the far left side of the screen is 0, and the far right is 1, an X position of 0.5 would represent the centre point of the screen. Similarly, if the top of the screen is 0 and the bottom is 1, a Y position of 0.2 would be 20% of the way down the screen. The same principles apply to both Width and Height as well (with a Width value of 0.5 meaning the window will be half as wide as the screen). The alternative to using relative values is using absolute (by passing false instead of true to guiCreateWindow). Absolute values are calculated as the total number of pixels from the top-left corner of the parent (if no gui element parent is specified, the parent is the screen itself). If we assume a screen resolution of 1920x1200, the far left side of the screen being 0 pixels and the far right being 1920 pixels, an X position of 960 will represent the centre point of the screen. Similarly, if the top of the screen is 0 pixels and the bottom is 1200, a Y position of 20 would be 20 pixels down from the top of the screen. The same principles apply to both Width and Height as well (with a Width value of 50 meaning the window will be 50 pixels wide). You can use guiGetScreenSize and a little maths to calculate certain absolute positions. The differences between using relative and absolute values is quite simple; gui created using absolute values will always remain exactly the same pixel size and position, while gui created using relative values will always be a percentage of its parent's size. Absolute is generally easier to maintain when editing code by hand, however your choice of type depends on the situation you are using it for. For the purposes of this introduction we will be using relative values. @Wassim: If he has a GUI window with 1900x1200 as its resolution and someone with 800x600 joins the game, he's unable to see half of the whole GUI window. What I propose is use relative positioning and scaling so none of this is an issue. Link to comment
Dealman Posted December 6, 2013 Share Posted December 6, 2013 I just answered this not too long ago. Try to search for it and you'll find it - and the answer. Link to comment
LiOneLMeSsIShoT Posted December 6, 2013 Author Share Posted December 6, 2013 I just answered this not too long ago. Try to search for it and you'll find it - and the answer. what..no you didn't reply here before now .... Link to comment
Dealman Posted December 6, 2013 Share Posted December 6, 2013 what..no you didn't reply here before now .... Not in this thread specifically, no. Hence why I told you to search. But I went ahead and spent the 10 seconds of searching, so you won't have to. This thread. 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