laserlaser Posted June 9, 2011 Share 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) Link to comment
will briggs Posted June 9, 2011 Share Posted June 9, 2011 May i ask what you need? Do you need help our is this an example... Link to comment
Callum Posted June 9, 2011 Share 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 Link to comment
karlis Posted June 10, 2011 Share 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. Link to comment
laserlaser Posted June 10, 2011 Author Share 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 =) Link to comment
Antibird Posted June 10, 2011 Share Posted June 10, 2011 2 lines are needed guiSetProperty( gui-window, "HorizontalAlignment", "Centre") guiSetProperty( gui-window, "VerticalAlignment", "Centre") Link to comment
laserlaser Posted June 10, 2011 Author Share Posted June 10, 2011 2 lines are neededguiSetProperty( gui-window, "HorizontalAlignment", "Centre") guiSetProperty( gui-window, "VerticalAlignment", "Centre") I think, shut up. Link to comment
Castillo Posted June 10, 2011 Share Posted June 10, 2011 laserlaser, please respect the forum rules and don't use bad language, edit your post. Link to comment
Antibird Posted June 10, 2011 Share Posted June 10, 2011 I think... I doubt u do. Forgiven anyway. Link to comment
SugarD-x Posted June 10, 2011 Share Posted June 10, 2011 Stop flaming unless you want the topic locked and you all to receive forum warnings...or worse. 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