FuriouZ Posted November 16, 2013 Share Posted November 16, 2013 Hello I have problem with button and image... I have created button on image, but if i press to the image,then i can't press to the button,i see it but nothing happens then,until i restart resource Link to comment
Dealman Posted November 16, 2013 Share Posted November 16, 2013 The image needs to be the parent of the button. Other than that, you could use guiBringToFront. Link to comment
HunT Posted November 16, 2013 Share Posted November 16, 2013 guiSetEnabled (image,false) Link to comment
tosfera Posted November 16, 2013 Share Posted November 16, 2013 Please note that, the guiBringToFront will cause a small problem with your cursor. For more details click here Link to comment
FuriouZ Posted November 16, 2013 Author Share Posted November 16, 2013 guiSetEnabled (image,false) Small line makes big problem .. Thanks ! [EDIT]: But now there's another problem, buttons what are created on this image what i disabled are too disabled ,how to fix it ? I tried guiSetEnabled (GUIEditor.button[9],true) But it didn't worked Link to comment
tosfera Posted November 16, 2013 Share Posted November 16, 2013 You disabled the image, are your buttons a child of your image? if so, your buttons will also be disabled. Link to comment
FuriouZ Posted November 16, 2013 Author Share Posted November 16, 2013 You disabled the image, are your buttons a child of your image? if so, your buttons will also be disabled. GUIEditor.staticimage[1] = guiCreateStaticImage(0.00, 0.00, 1.00, 1.00, "img/backround.png", true) guiSetEnabled (GUIEditor.staticimage[1],false) showCursor(true) -- -- -- GUIEditor.button[9] = guiCreateButton(0.42, 0.94, 0.16, 0.06, "Enter", true, GUIEditor.staticimage[1]) guiSetEnabled (GUIEditor.button[9],true) Link to comment
Dealman Posted November 16, 2013 Share Posted November 16, 2013 You should look up how the GUI Hierarchy works. By default, when a parent is set as disabled - the children will be as well. In this case, your button is a child of your Image. Therefore when you disable the image, the button will be disabled too. And if your button is not a child of your image, it will be brought to the back if you click on the image. 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