OnMouseOver events on transparent sprite
-
I created some FlxSprites and loaded some images, and I set their alpha to 0. I want to use them as mouse hit areas in my game. How do I trigger onMouseOver events on those transparent sprites? At the moment to make it work I have to set alpha to 0.1, but I want to make the sprites totally invisible. Is that possible? Thanks!
-
You need to set the
PixelPerfect
parameter tofalse
.http://api.haxeflixel.com/flixel/input/mouse/FlxMouseEventManager.html#add
-
@Gama11 Thanks Gama11,
But that will treat the sprite as a rectangular box, so it's not accurate for complex shapes.
I attached a screenshot. Is it possible to make the areas with magenta color invisible and still detect when the mouse is over them?
-
I'm not sure that's currently supported.