Skip to content

Mouse.as doesn't like negative cursor offsets mixed with native Flash #24

Open
@moly

Description

@moly

This is a bit of an edge case, but it's something that will be a rather unfun "gotcha" if you happen to be mixing native Flash display objects with Flixel.

If you want to center a mouse cursor, and use something like this:

FlxG.mouse.show (ImgMouseRecticle, 1, -12, -12) ;

Then mouse events will stop firing for any Flash objects which happen to be above the FlxCamera Sprites but below the Mouse sprite. The reason for this is because the _cursor sprite will always be on top of whatever is below, and will receive all of the mouse events and not pass them on (as is default). (With a positive offset, you would never notice this because the _cursor sprite wouldn't be on top of the mouse location.)

A solution to this is to add

_cursorContainer.mouseEnabled = false ;

To the Mouse constructor.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions