|
| 06 Jan 2014 07:46 AM |
When there's a script that runs a function when a TextButton is clicked, does it seriously need to be in the same frame/parent item as the button? I've tried to do this other ways, but none of them work unless the script and button are in the same parent.
Am I doing something wrong, or does Roblox do this naturally? |
|
|
| Report Abuse |
|
|
|
| 06 Jan 2014 07:48 AM |
Not really. If you have a text button in a frame in a screen gui, and the script is in the screen gui, you can do this:
script.Parent.Frame.TextButton.MouseButton1Down:connect(function() end) |
|
|
| Report Abuse |
|
|
|
| 06 Jan 2014 07:52 AM |
That's what I've done, but it won't work. . - .
However, in this case; The layout is like this;
ScreenGui >Script >Frame1 >>ButtonA >Frame2 >>Frame2b >>>ButtonB >>>ButtonC etc. |
|
|
| Report Abuse |
|
|
|
| 06 Jan 2014 07:53 AM |
| Are you running all of the events in one script? |
|
|
| Report Abuse |
|
|
|
| 06 Jan 2014 07:54 AM |
If so,
do this:
coroutine.wrap(function() --Button 1 click stuff end)()
coroutine.wrap(function() --Button 2 click stuff end)()
--Button 3 click stuff |
|
|
| Report Abuse |
|
|
|
| 06 Jan 2014 08:06 AM |
Okay, and here's another problem. While I can now click on them, it's only around the edges. Inside of each button I have ImageButton that only acts as an image for the button. I cna't click the utotn because the image is in the way, and when I set the image's activeness to false, they get a gray box over them....
Any tips on how to remove the gray box? (It's not the BackgroundTransparency as far as I can tell.) |
|
|
| Report Abuse |
|
|
moryo7
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 5028 |
|
|
| 06 Jan 2014 08:44 AM |
One way you can do it is to have both the imagebutton and the textbutton to do the same thing.
Alternatively, you can put another textbutton with a ZIndex higher than the original buttons over them, and make the background transparency 1, with no text.
✦мøяƴø子✦ |
|
|
| Report Abuse |
|
|
breuning
|
  |
| Joined: 30 Oct 2008 |
| Total Posts: 4268 |
|
|
| 06 Jan 2014 08:51 AM |
why do you use imagebuttons as images for textbuttons either use imagebuttons or imagelabels and textbuttons |
|
|
| Report Abuse |
|
|
|
| 06 Jan 2014 08:31 PM |
@Previous Post
I wanted the seleciton box around the image as well, but if it was in any style other than custom, the image would get super small. |
|
|
| Report Abuse |
|
|