Koella Posted April 15, 2013 Posted April 15, 2013 Hello I am creating a GUI at the moment, but I kinda don't want to add a big close button. I'd much rather have a little "x" at the top right corner. I've tried achieving that with the property "CloseButtonEnabled", but it didn't work for me. Any ideas how I could still get the "x"-button, even if the property doesn't work accordingly? Or does the property work and I'm just not using it correctly? I'm using the function like this: guiSetProperty(wdwGUIWindow, CloseButtonEnabled, true) Thanks in advance - Koella
Castillo Posted April 15, 2013 Posted April 15, 2013 I've never used that property, but you can use: onClientGUIClick guiSetVisible San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Koella Posted April 15, 2013 Author Posted April 15, 2013 Yes, but to use that I would need to create an own "close" button, which I would not be able to place in the top right corner of the window. And I'd love to not have a big "close" button in the mid of my GUI window ^^ I'd really prefer having a little "x" somewhere where it doesn't disturb. xP
xXMADEXx Posted April 15, 2013 Posted April 15, 2013 Use MTA wiki. www.wiki.multitheftauto.com The Ultimate Lua Tutorial! | MTA PHP SDK
Koella Posted April 15, 2013 Author Posted April 15, 2013 Well that's not really an useful comment... I wouldn't have posted in here if I could find something in the wiki... Searched it long enough
Max+ Posted April 15, 2013 Posted April 15, 2013 addEventHandler('onClientGUIClick' , root, function ( ) if ( source == 'ButtonName' ) then guiSetVisible (windoName , false) --- to hid = false show = true ...... - New , Kill System - New, GameMode Intro - Leve / Exp System - New nametag showing style - New , Hud For Players - Skin Selection from SA-MP - Money System / Buy Weapons - Drop Weapons - New, Flood System - New , Group Assign - Gun license For Weapons - Random Rule System For Money
Castillo Posted April 15, 2013 Posted April 15, 2013 I don't really understand what do you mean, with that event and function, you can do it, the text you used in the button doesn't matter ( "X", "close", etc ). San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
panos144 Posted April 16, 2013 Posted April 16, 2013 Do you mean somethink like that? GUIEditor = { button = {}, window = {} } GUIEditor.window[1] = guiCreateWindow(174, 135, 490, 299, "", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible(GUIEditor.window[1], false) GUIEditor.button[1] = guiCreateButton(449, 29, 27, 35, "X", false, GUIEditor.window[1]) function hidegui() guiSetVisible(GUIEditor.window[1], false) showCursor ( false ) end addEventHandler ( "onClientGUIClick", GUIEditor.button[1], hidegui, false ) SAPS:RPG owner In game name:panagiotis
Koella Posted April 16, 2013 Author Posted April 16, 2013 Thanks for your reply Max+, you actually helped us fix another little bug we had with our GUI We think we also have a solution for the initial problem, we will test it out, and I will edit the results into this post if it works out ^^ Thanks again for all your replies, guys xP
Max+ Posted April 16, 2013 Posted April 16, 2013 No , Problem Man Wating For You .. - New , Kill System - New, GameMode Intro - Leve / Exp System - New nametag showing style - New , Hud For Players - Skin Selection from SA-MP - Money System / Buy Weapons - Drop Weapons - New, Flood System - New , Group Assign - Gun license For Weapons - Random Rule System For Money
Castillo Posted April 17, 2013 Posted April 17, 2013 Do you mean somethink like that? GUIEditor = { button = {}, window = {} } GUIEditor.window[1] = guiCreateWindow(174, 135, 490, 299, "", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible(GUIEditor.window[1], false) GUIEditor.button[1] = guiCreateButton(449, 29, 27, 35, "X", false, GUIEditor.window[1]) function hidegui() guiSetVisible(GUIEditor.window[1], false) showCursor ( false ) end addEventHandler ( "onClientGUIClick", GUIEditor.button[1], hidegui, false ) Yes, that'll work. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Koella Posted April 17, 2013 Author Posted April 17, 2013 We looked at the code of the GUIEditor resource and looked at how they got the button in their window titlebar. Afterwards we were able to make our own little "Close" button in the titlebar, at the top right corner of the window
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