Drag and drop - FlxMouseEventManager
I'm a beginner with HaxeFlixel.
Anybody can help me with an example of drag and drop with FlxMouseEventManager? There's no onMouseMove event and I've a problem with OnMouseUp not fired if the mouse if out of the sprite.
Have you checked the
FlxMouseEventManagerdemo? It implements a basic drag-and-drop functionality.
Great, thanks, following this example I've done a first step, drag and drop mouse driven. Building for Android my test project I then realized that the mouse is not supported and I need to use FlxTouchManager instead, any good example with this? The basic question is to understand how get the touched sprite reference.
I then realized that the mouse is not supported and I need to use FlxTouchManager instead
That's not true, you can use the mouse on mobile, as long as you don't need to support multi-touch. The first touch will fire mouse events. It may be this line in the default
Project.xmlthat's causing you trouble:
<haxedef name="FLX_NO_MOUSE" if="mobile" />
Just comment this out if you want to use the mouse on mobile.