|
Hi, all! I would like to do this: I have a GUITexture titled 'arrow', and I want it to set its transform.position.y to the transform.position.y of whatever GUILabel the mouse is currently hovering over. Is this possible? How so? EDIT I have changed the code... The only problem I have now is that when the event fires, the arrow disappears from view, like the y value is off... What's up with that? The latest bit of code (Edit #3)
(comments are locked)
|
|
Alright. I got the script running quite well! I just had to change the transform into pixelInset. Thanks for the help guys! -YA The completed script I ended up having to make the 'makeup' variable to keep the arrow aligned with the text
(comments are locked)
|
|
I am not sure I get this right so I will say considering your "I most definitely want to highlight". So this is going to highlight or change the color of the text when you hover the mouse on top of it like you would get on the menu of a game. I would use a 3DText for your words then add a box collider to each of them and then finally: This consider that the original color is white and it turns blue when you place the cursor on top of it and gets back to white when you leave. Once again, I am not sure of what you want, just trying to help though. Haha. A bit of a hack solution, but it would work... Still, it is not versatile enough for what I would want to do... Please check my main post, and maybe you'll get a better idea of what I'm talking about. Thanks man!- YA
Dec 17 '11 at 03:41 PM
Youngapprentice
Yep the picture wasn't there (or did not show up) when I posted this.
Dec 17 '11 at 03:43 PM
fafase
(comments are locked)
|
|
Ok I know what you mean now. You are almost there. This line means that if your mouse cursor is somewhere in the area of Rect called Choice1 it will do something. Since you want it to work for your labels, I suggest to define them all, so you don't have to write the same stuff again and again. So add (160,300,350,70) coords to your Choice1 variable - same for all the others (Choice2, Choice3 etc) Then it should look like this Tell me if this works because I'm not a java guy Although this does not work, I makes my life easier, because I get to set the values in the inspector like Lo0NuhtiK said. SO MUCH EASIER THANK YOU! Sadly, this did not fix my problem. But we are much closer now. The debug.Log is triggering, just not in the expected area. I will edit my main post, add the updated code (see Code#2) and supply a picture about what is happening. thanks for the help so far, guys! - YA
Dec 17 '11 at 03:34 PM
Youngapprentice
(comments are locked)
|

you want a custom mouse cursor so that your arrow follows mouse or you want the arrow to 'highlight' current dialog option?
I most definitely want to highlight