scienziato-pazzo Posted January 15, 2014 Share Posted January 15, 2014 Hi, I used this script: local x, y = guiGetScreenSize() local sx, sy = x/1440, y/900 GUIEditor.button[1] = guiCreateButton(446*sx, 450*sy, 173*sx, 54*sy, "Login", false) GUIEditor.button[2] = guiCreateButton(667*sx, 450*sy, 173*sx, 54*sy, "Registrati", false) GUIEditor.label[1] = guiCreateLabel(461*sx, 261*sy, 58*sx, 18*sy, "Username", false) GUIEditor.label[2] = guiCreateLabel(461*sx, 378*sy, 58*sx, 18*sy, "Password", false) GUIEditor.edit[1] = guiCreateEdit(648*sx, 270*sy, 187*sx, 27*sy, "", false) GUIEditor.edit[2] = guiCreateEdit(648*sx, 378*sy, 187*sx, 27*sy, "", false) But the labels are showed completely on 1440x900 resolution, but not on 800x600 resolution. Why? Link to comment
0xCiBeR Posted January 15, 2014 Share Posted January 15, 2014 Because of: local sx, sy = x/1440, y/900 Try This: local sx, sy = guiGetScreenSize() GUIEditor.button[1] = guiCreateButton(sx/446, sy/450, sx/173, sy/54, "Login", false) GUIEditor.button[2] = guiCreateButton(sx/667, sy/450, sx/173, sy/54, "Registrati", false) GUIEditor.label[1] = guiCreateLabel(sx/461, sy/261, sx/58, sy/18, "Username", false) GUIEditor.label[2] = guiCreateLabel(sx/461, sy/378, sx/58, sy/18, "Password", false) GUIEditor.edit[1] = guiCreateEdit(sx/648, sy/270, sx/187, sy/27, "", false) GUIEditor.edit[2] = guiCreateEdit(sx/648, sy/378, sx/187, sy/27, "", false) Link to comment
scienziato-pazzo Posted January 15, 2014 Author Share Posted January 15, 2014 Because of: local sx, sy = x/1440, y/900 Try This: local sx, sy = guiGetScreenSize() GUIEditor.button[1] = guiCreateButton(sx/446, sy/450, sx/173, sy/54, "Login", false) GUIEditor.button[2] = guiCreateButton(sx/667, sy/450, sx/173, sy/54, "Registrati", false) GUIEditor.label[1] = guiCreateLabel(sx/461, sy/261, sx/58, sy/18, "Username", false) GUIEditor.label[2] = guiCreateLabel(sx/461, sy/378, sx/58, sy/18, "Password", false) GUIEditor.edit[1] = guiCreateEdit(sx/648, sy/270, sx/187, sy/27, "", false) GUIEditor.edit[2] = guiCreateEdit(sx/648, sy/378, sx/187, sy/27, "", false) It doesn't work. It sets a wrong position. Link to comment
0xCiBeR Posted January 15, 2014 Share Posted January 15, 2014 And this:? local sx, sy = guiGetScreenSize() GUIEditor.button[1] = guiCreateButton(446*sx, 450*sy, 173*sx, 54*sy, "Login", false) GUIEditor.button[2] = guiCreateButton(667*sx, 450*sy, 173*sx, 54*sy, "Registrati", false) GUIEditor.label[1] = guiCreateLabel(461*sx, 261*sy, 58*sx, 18*sy, "Username", false) GUIEditor.label[2] = guiCreateLabel(461*sx, 378*sy, 58*sx, 18*sy, "Password", false) GUIEditor.edit[1] = guiCreateEdit(648*sx, 270*sy, 187*sx, 27*sy, "", false) GUIEditor.edit[2] = guiCreateEdit(648*sx, 378*sy, 187*sx, 27*sy, "", false) Link to comment
Gallardo9944 Posted January 15, 2014 Share Posted January 15, 2014 And this:? local sx, sy = guiGetScreenSize() GUIEditor.button[1] = guiCreateButton(446*sx, 450*sy, 173*sx, 54*sy, "Login", false) GUIEditor.button[2] = guiCreateButton(667*sx, 450*sy, 173*sx, 54*sy, "Registrati", false) GUIEditor.label[1] = guiCreateLabel(461*sx, 261*sy, 58*sx, 18*sy, "Username", false) GUIEditor.label[2] = guiCreateLabel(461*sx, 378*sy, 58*sx, 18*sy, "Password", false) GUIEditor.edit[1] = guiCreateEdit(648*sx, 270*sy, 187*sx, 27*sy, "", false) GUIEditor.edit[2] = guiCreateEdit(648*sx, 378*sy, 187*sx, 27*sy, "", false) I imagine 446*1280 if your resolution is 1280x720, lol. You shouldn't use 2 scale values cause if a screen is not widescreen, then the elements will be stretched out. Link to comment
scienziato-pazzo Posted January 15, 2014 Author Share Posted January 15, 2014 And this:? local sx, sy = guiGetScreenSize() GUIEditor.button[1] = guiCreateButton(446*sx, 450*sy, 173*sx, 54*sy, "Login", false) GUIEditor.button[2] = guiCreateButton(667*sx, 450*sy, 173*sx, 54*sy, "Registrati", false) GUIEditor.label[1] = guiCreateLabel(461*sx, 261*sy, 58*sx, 18*sy, "Username", false) GUIEditor.label[2] = guiCreateLabel(461*sx, 378*sy, 58*sx, 18*sy, "Password", false) GUIEditor.edit[1] = guiCreateEdit(648*sx, 270*sy, 187*sx, 27*sy, "", false) GUIEditor.edit[2] = guiCreateEdit(648*sx, 378*sy, 187*sx, 27*sy, "", false) No. Link to comment
Gallardo9944 Posted January 15, 2014 Share Posted January 15, 2014 Should be fine. Untested. local x, y = guiGetScreenSize() local scale = y/900 GUIEditor.button[1] = guiCreateButton(446*scale, 450*scale, 173*scale, 54*scale, "Login", false) GUIEditor.button[2] = guiCreateButton(667*scale, 450*scale, 173*scale, 54*scale, "Registrati", false) GUIEditor.label[1] = guiCreateLabel(461*scale, 261*sscale, 58*scale, 18*scale, "Username", false) GUIEditor.label[2] = guiCreateLabel(461*scale, 378*scale, 58*scale, 18*scale, "Password", false) GUIEditor.edit[1] = guiCreateEdit(648*scale, 270*scale, 187*scale, 27*scale, "", false) GUIEditor.edit[2] = guiCreateEdit(648*scale, 378*scale, 187*scale, 27*scale, "", false) Link to comment
scienziato-pazzo Posted January 15, 2014 Author Share Posted January 15, 2014 Should be fine. Untested. local x, y = guiGetScreenSize() local scale = y/900 GUIEditor.button[1] = guiCreateButton(446*scale, 450*scale, 173*scale, 54*scale, "Login", false) GUIEditor.button[2] = guiCreateButton(667*scale, 450*scale, 173*scale, 54*scale, "Registrati", false) GUIEditor.label[1] = guiCreateLabel(461*scale, 261*sscale, 58*scale, 18*scale, "Username", false) GUIEditor.label[2] = guiCreateLabel(461*scale, 378*scale, 58*scale, 18*scale, "Password", false) GUIEditor.edit[1] = guiCreateEdit(648*scale, 270*scale, 187*scale, 27*scale, "", false) GUIEditor.edit[2] = guiCreateEdit(648*scale, 378*scale, 187*scale, 27*scale, "", false) Now I can see the gui elements, but the labels are "Userna" and "Passwo". They display only 6 characters. Link to comment
scienziato-pazzo Posted January 15, 2014 Author Share Posted January 15, 2014 Solved. I had to increment the scaleX and the scaleY. 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