JayTheDJ
|
  |
| Joined: 07 Aug 2011 |
| Total Posts: 262 |
|
|
| 25 Aug 2012 03:47 PM |
How do those function work? I'm new to GUI's and I want to learn how you use them. For example, like onClicked you click i the desired object whatever was scripted would happen. How does this work on GUI's.
For example, what I am trying to do is make some simple GUI imagebuttons where they do the basic actions such as kill or sit. How would I do this?
Also, I would like to learn how to use MouseEnter and MouseLeave. |
|
|
| Report Abuse |
|
|
|
| 25 Aug 2012 03:49 PM |
MouseButton1Click is an event, not a method.
It fires something when someone leftclicks on something; for example in a gui you could put
script.Parent.MouseButton1Click:connect(function() print("Someone clicked a Gui!") end) |
|
|
| Report Abuse |
|
|
|
| 25 Aug 2012 03:52 PM |
| mousebutton1click is a userdata containing connect *method* |
|
|
| Report Abuse |
|
|
JayTheDJ
|
  |
| Joined: 07 Aug 2011 |
| Total Posts: 262 |
|
|
| 25 Aug 2012 03:53 PM |
I was actually looking how to word line 1.
If I replace the event "MouseButton1Click" with "MouseEnter" then would whatever the desired thing I want to enter still work? |
|
|
| Report Abuse |
|
|
|
| 25 Aug 2012 03:54 PM |
| It's primary use is as an event, for example script.Parent.MouseButton1Click:connect() |
|
|
| Report Abuse |
|
|
JayTheDJ
|
  |
| Joined: 07 Aug 2011 |
| Total Posts: 262 |
|
|
| 25 Aug 2012 04:11 PM |
script.Parent.MouseEnter:connect(function() print("Someone moved over this gui!") end)
Would work? |
|
|
| Report Abuse |
|
|
JayTheDJ
|
  |
| Joined: 07 Aug 2011 |
| Total Posts: 262 |
|
|
| 25 Aug 2012 04:56 PM |
HELP!
Ok so I have a scripting problem, I tried modifying a script and even using the output but nothing is helping me.
I want to use "MouseEnter" and "MouseLeave"
If the mouse enters the TextBox will be visible
TextBox.Visible = true
and when the mouse leaves
TextBox.Visible = false |
|
|
| Report Abuse |
|
|
|
| 25 Aug 2012 05:06 PM |
Post the script, but your example was used correctly, assuming that the script's parent was a GuiObject.
¤¤ †KMXD† ¤¤ [Scripting Helper Tier~3] |
|
|
| Report Abuse |
|
|
JayTheDJ
|
  |
| Joined: 07 Aug 2011 |
| Total Posts: 262 |
|
|
| 25 Aug 2012 05:27 PM |
I looked it up on the wiki and it showed me this, " Arguments x, and y specify the absolute pixel position of the mouse." So I looked up the ResetButton's AbsolutePosition and it showed me 0,0. So this is what I did. (So that no one claims I'm asking for the scripts)
script.Parent.MouseEnter(0,0):connect(function() TextBox.Visible = true end)
NOTE: The TextBox is in the ResetButton.
I do not know how to do the mouse leave. |
|
|
| Report Abuse |
|
|
|
| 25 Aug 2012 05:31 PM |
script.Parent.MouseEnter:connect(function() TextBox.Visible = true end) script.Parent.MouseLeave:connect(function() TextBox.Visible = false end)
¤¤ †KMXD† ¤¤ [Scripting Helper Tier~3] |
|
|
| Report Abuse |
|
|