jeremaniak Posted May 5, 2012 Share Posted May 5, 2012 Wich commands will set your gui in the middle onResourceStart? thanks in advance Link to comment
NextGenRP Posted May 5, 2012 Share Posted May 5, 2012 Use guiSetVisible at the start of the resource and it will be depending on the x,y arguments of the window i think. Link to comment
jeremaniak Posted May 5, 2012 Author Share Posted May 5, 2012 i understand but i want it right in the middle Link to comment
Reflex# Posted May 5, 2012 Share Posted May 5, 2012 Use guiSetVisible at the start of the resource and it will be depending on the x,y arguments of the window i think. Ye he say true function changeVisibility ( ) -- we check if the gui element is visible guiSetVisible (myWindow, not guiGetVisible ( myWindow ) ) end --Create a gui window called 'myWindow' myWindow = guiCreateWindow ( 0.3, 0.3, 0.5, 0.60, "GUI window title", true ) --Set a timer to change the window's visibility every 2 seconds, infinite times setTimer ( changeVisibility, 2000, 0 ) https://wiki.multitheftauto.com/wiki/GuiSetVisible here can find more Link to comment
Reflex# Posted May 5, 2012 Share Posted May 5, 2012 i understand but i want it right in the middle You need change x,y of this guiWindow Link to comment
Jaysds1 Posted May 5, 2012 Share Posted May 5, 2012 Here's a code: local screenWidth, screenHeight = guiGetScreenSize() local windowWidth, windowHeight = 240, 89 local left = screenWidth/2 - windowWidth/2 local top = screenHeight/2 - windowHeight/2 prog = guiCreateWindow(left, top, windowWidth, windowHeight,MIDDLE, false) You should use this program, It helped me with my Login GUI: viewtopic.php?f=91&t=27739&p=427822&hilit=+LUA#p427765 Link to comment
Castillo Posted May 5, 2012 Share Posted May 5, 2012 If you want to center a GUI, then use this function: https://wiki.multitheftauto.com/wiki/CenterWindow 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