NGUI !OnHover

well i have been messing around with Ngui now for a bit, and i have now come to a standstil :confused:
i got an Ngui sprite that when i mouse over, enables another sprite, and whne idont mouse over anymore, the sprite disapears im not that good yet at programming and dont know the “cool little commands” to everything yet :confused: but im learning. what i got this far is this

void OnHover(){
		controller.tooltipAnchor.SetActive(true);

}

so my question is now, what and how do i write it so that when i dont mouse over, the “controller.tooltipAnchor.SetActive(true);” is set to false instead? :confused: thanks in advance guys!

1 Answer

1

When you go to the NGUI documentation:

http://www.tasharen.com/?page_id=160

you’ll see that the OnHover event actually takes in a boolean parameter. So, what your code should actually look like is:

void OnHover( bool isOver )
{
    if( isOver )
        controller.tooltipAnchor.SetActive(true);
    else
        controller.tooltipAnchor.SetActive(false);
}

oh my god dude... if i could i would kiss you right now! xD i completely misunderstood what it said on the documentation, i can really feel how green i am hehe! thank you so much man! really appreaciated!

that's what we're here for, everybody's gotta start somewhere!

I thought you were gona say "that's what we're here for, somebody has to receive the kisses"