Enargy, Posted December 5, 2013 Share Posted December 5, 2013 because using 'guiGetScreenSize' The position does not change but changing my resolution changes, I want the gui is in its original position for all resolutions. local sx,sy = guiGetScreenSize() function gui() wnd = guiCreateStaticImage(sx / 2.5 - 310, sy / 1.4 - 260, 132, 252, "images/window_sect.png", false) end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), gui) Link to comment
xCore Servers Posted December 5, 2013 Share Posted December 5, 2013 You want the GUI image in the center of the screen? Use this: local windowW,windowH=guiGetSize(wnd,false) local sWidth,sHeight = guiGetScreenSize() local x,y = (sWidth-windowW)/2,(sHeight-windowH)/2 guiSetPosition(wnd,x,y,false) Link to comment
Enargy, Posted December 5, 2013 Author Share Posted December 5, 2013 And if I want to move left or right? Link to comment
xCore Servers Posted December 6, 2013 Share Posted December 6, 2013 Use x-(a number) example: guiSetPosition(wnd,x - 250,y - 250,false) 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