Drag and drop - FlxMouseEventManager



  • Hi All,
    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.
    Thanks!


  • administrators

    Have you checked the FlxMouseEventManager demo? It implements a basic drag-and-drop functionality.

    http://haxeflixel.com/demos/FlxMouseEventManager/



  • 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.


  • administrators

    @fede said in Drag and drop - FlxMouseEventManager:

    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.xml that's causing you trouble:

    <haxedef name="FLX_NO_MOUSE" if="mobile" />
    

    Just comment this out if you want to use the mouse on mobile.


Log in to reply
 

Looks like your connection to HaxeFlixel was lost, please wait while we try to reconnect.