JR10 Posted July 14, 2011 Share Posted July 14, 2011 Lol???, 1297 1023 and it's relative? And, why you are getting the x, y and you didn't use it. Link to comment
CapY Posted July 15, 2011 Author Share Posted July 15, 2011 I don't know wtf i was doing with that code Glitch ftw ! Link to comment
drk Posted February 27, 2012 Share Posted February 27, 2012 To make a gui element working in the same place in the screen but working for all resolutions only use: (posX/resolutionWidth)*xguiGetScreenSizeVariable, (posY/resolutionHeight)*yguiGetScreenSizeVariable, (width/resolutionWidth)*xguiGetScreenSizeVariable, (height/resolutionHeight)*yguiGetScreenSizeVariable Link to comment
CapY Posted February 27, 2012 Author Share Posted February 27, 2012 Why are you bumping such old topic ? I know how it's done and I don't need help. Link to comment
drk Posted February 27, 2012 Share Posted February 27, 2012 Why you only think in you? Others may not know how to do. Link to comment
CapY Posted February 27, 2012 Author Share Posted February 27, 2012 Then let me help them. There's 2 types of GUI's: Absolute and Relative. I recommend using relative for beginners and absolute for advanced scripters. For example: guiCreateStaticImage ( float x, float y, float width, float height, string path, bool relative, [element parent = nil] ) Float x = integer ( number ( 0-9999 ) ), represents a position of window in X units. Float y = integer ( number ( 0-9999 ) ), represent a position of GUI element in Y units. Float width = integer ( number ( 0-9999 ) ), represents the size of GUI element. Example: <--------------------------------------> Float height = integer ( number ( 0-9999 ) ), represents the size of GUI element. Example: ^ | | | | | | v string = "blablabla", "", ' ', basically quotes. bool = true and false element parent = nil - this is an optional argument. nil = represents nothing Example of usage: guiCreateStaticImage( 0.20, 0.200, 0.100, 0.100, "imagename.png",true ) Relative GUI's has to contain decimals in integers, while Absolute ones don't. For having accurate absolute GUI's, simply use this: local screenWidth, screenHeight = guiGetScreenSize() local windowWidth, windowHeight = 800, 600 local left = screenWidth/2 - windowWidth/2 local top = screenHeight/2 - windowHeight/2 Apologises for mistakes, I'm in rush. Link to comment
qaisjp Posted February 27, 2012 Share Posted February 27, 2012 What is this I don't even... Link to comment
CapY Posted February 27, 2012 Author Share Posted February 27, 2012 What is this I don't even... Link to comment
drk Posted February 27, 2012 Share Posted February 27, 2012 Then let me help them.There's 2 types of GUI's: Absolute and Relative. I recommend using relative for beginners and absolute for advanced scripters. For example: guiCreateStaticImage ( float x, float y, float width, float height, string path, bool relative, [element parent = nil] ) Float x = integer ( number ( 0-9999 ) ), represents a position of window in X units. Float y = integer ( number ( 0-9999 ) ), represent a position of GUI element in Y units. Float width = integer ( number ( 0-9999 ) ), represents the size of GUI element. Example: <--------------------------------------> Float height = integer ( number ( 0-9999 ) ), represents the size of GUI element. Example: ^ | | | | | | v string = "blablabla", "", ' ', basically quotes. bool = true and false element parent = nil - this is an optional argument. nil = represents nothing Example of usage: guiCreateStaticImage( 0.20, 0.200, 0.100, 0.100, "imagename.png",true ) Relative GUI's has to contain decimals in integers, while Absolute ones don't. For having accurate absolute GUI's, simply use this: local screenWidth, screenHeight = guiGetScreenSize() local windowWidth, windowHeight = 800, 600 local left = screenWidth/2 - windowWidth/2 local top = screenHeight/2 - windowHeight/2 Apologises for mistakes, I'm in rush. I recommend using relative for beginners and absolute for advanced scripters. Same thing... Link to comment
CapY Posted February 27, 2012 Author Share Posted February 27, 2012 Same thing... Absolute GUI elements are NOT always correct on all resolutions while relative ones are. Link to comment
drk Posted February 27, 2012 Share Posted February 27, 2012 Same thing... Absolute GUI elements are NOT always correct on all resolutions while relative ones are. I know. But what you said isn't about what I said... I said "Same thing..." about "I recommend relative for begginers and absolute for advanceds". Link to comment
CapY Posted February 27, 2012 Author Share Posted February 27, 2012 It's not the same thing, beginners won't know how to properly calculate it. Link to comment
drk Posted February 27, 2012 Share Posted February 27, 2012 No, but can use GUIEditor, GUIEditor use absolute position by default, no? Link to comment
CapY Posted February 27, 2012 Author Share Posted February 27, 2012 It uses whatever you set ( in options ). Link to comment
drk Posted February 27, 2012 Share Posted February 27, 2012 I know, but by default, if begginers don't know how to change, absolute positions will be defaulted. Link to comment
CapY Posted February 27, 2012 Author Share Posted February 27, 2012 They can use QT to Lua with QTDesigner. 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