Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
moly opened this issue Aug 30, 2012 · 0 comments
Open

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

moly opened this issue Aug 30, 2012 · 0 comments
Labels

Comments

@moly
Copy link
Owner

moly commented Aug 30, 2012

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant