laserlaser Posted June 9, 2011 Posted June 9, 2011 function centerWindow(center_window) local screenW,screenH=guiGetScreenSize() local windowW,windowH=guiGetSize(center_window,false) local x,y = (screenW-windowW)/2,(screenH-windowH)/2 guiSetPosition(center_window,x,y,false) end Example local wnd = guiCreateWindow(...) centerWindow(wnd)
will briggs Posted June 9, 2011 Posted June 9, 2011 May i ask what you need? Do you need help our is this an example...
Callum Posted June 9, 2011 Posted June 9, 2011 You could make it; function centerWindow(window) local resX,resY = guiGetScreenSize() local w,h = guiGetSize(window,false) guiSetPosition(window,(resX/2)-(w/2),(resY/2)-(h/2),false) end
karlis Posted June 10, 2011 Posted June 10, 2011 it would be most effective and recommended to put guiGetScreenSize() at front of any clientside script with dx/gui functions, so you don't have to call twice.
laserlaser Posted June 10, 2011 Author Posted June 10, 2011 It works, do you want to see? I want, and screen shots; Before After @karlis I can not understand you because my english is little english =)
Antibird Posted June 10, 2011 Posted June 10, 2011 2 lines are needed guiSetProperty( gui-window, "HorizontalAlignment", "Centre") guiSetProperty( gui-window, "VerticalAlignment", "Centre")
laserlaser Posted June 10, 2011 Author Posted June 10, 2011 2 lines are neededguiSetProperty( gui-window, "HorizontalAlignment", "Centre") guiSetProperty( gui-window, "VerticalAlignment", "Centre") I think, shut up.
Castillo Posted June 10, 2011 Posted June 10, 2011 laserlaser, please respect the forum rules and don't use bad language, edit your post.
SugarD-x Posted June 10, 2011 Posted June 10, 2011 Stop flaming unless you want the topic locked and you all to receive forum warnings...or worse.
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