User Tag List

Results 1 to 7 of 7

Thread: MMF 2 - Odd Drag and Drop Behavior

  1. #1
    Clicker Fusion 2.5 DeveloperHTML5 Export Module

    Join Date
    Jun 2006
    Posts
    1,469
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)

    MMF 2 - Odd Drag and Drop Behavior

    If you create a new application with a frame. Then add an object like a ball.

    Condition: When cursor is over ball and left mouse button is held down
    Action: Set x, y locaton of ball to x, y location of mouse.

    Problem I found this that it does not work and spotty in the way ball would try and fail to follow the mouse pointer.

    Solution was to set up a counter

    CONDITION: IF MOUSE IS OVER BALL
    ACTION: SET COUNTER TO 1

    CONDITION: IF LEFT MOUSE BUTTON IS PRESSED AND COUNTER = 1
    ACTION: SET X,Y OF BALL TO X,Y OF MOUSE.

    Not sure why a counter is needed. Drag and drop worked fine with a counter however. Ball would follow mouse and drop fine. Seems like a bug. Maybe checking speed in engine between first case and second???

  2. #2
    Clickteam Clickteam
    Anders's Avatar
    Join Date
    Jun 2006
    Location
    Denmark, Århus
    Posts
    3,456
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)

    Re: MMF 2 - Odd Drag and Drop Behavior

    By default MMF2 only runs 50 frames per second but the mouse moves much faster + that the mouse doen't move "smoothly" when moving fast. If you move the mouse fast enough, the mouse makes a big jump in it's position and gets outside the object and then making the 'mouse overlaps object' false and stopping the object getting dragged.

    A good way to drag objects that is pretty safe:


    + Mouse clicks on "Object"
    ---> Set flag 0 ON

    + [Object] If flag 0 is ON
    ---> Set position to the mouse

    [:"red"]X[/] Repeat while mouse key is pressed
    ---> Set flag 0 OFF


    If you want to prevent multiple overlapping objects from being dragged if they overlap when you click them, you can maybe insert a 'pick "object" at random' condition into the first event. If that doesn't work, you can replace the 'click' condition with a 'repeat while mouse key is pressed' condition and an 'only one action when event loops' condition.

  3. #3
    No Products Registered

    Join Date
    Jun 2006
    Location
    here
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: MMF 2 - Odd Drag and Drop Behavior

    This is not a bug, and no matter how fast you make the FPS, you will not make this failsafe (since windows itself makes the mouse jump large distances if moved fast). The counter method you're using is really the only way to do this.

    Don't be afraid to do things the hard way; it's what programming is all about <img src="/center/images/graemlins/wink.gif" alt="" />

  4. #4
    Clicker Fusion 2.5 DeveloperSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jun 2006
    Posts
    395
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: MMF 2 - Odd Drag and Drop Behavior

    What about this?

    ______________________
    When Mouse is Over Active
    + Repeat while Left Mouse Button is pressed
    Active Flag 0 On
    _______________________

    X Repeat while Left Mouse Button is pressed
    Active Flag 0 OFF
    _______________________
    Active Flag 0 is On
    Activate Group "Drag Ball"
    _______________________
    Active Flag 0 is Off
    Deactivate Group "Drag Ball"

    _______________________
    GROUP "Drag Ball"
    Always
    Set Position to XMouse YMouse


    Thats how I do my Drag and Drop for Actives and it works 100%

  5. #5
    Clickteam Clickteam
    Anders's Avatar
    Join Date
    Jun 2006
    Location
    Denmark, Århus
    Posts
    3,456
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)

    Re: MMF 2 - Odd Drag and Drop Behavior

    Having groups for such a simple thing is a bit of an overkill IMHO.

    I think the 3 event method I posted is the best. That way you can also do relative drag and drop if you store relative coordinates in alterable values. Much neater than forcing the drag to stick to the hotspot.

  6. #6
    Clicker Fusion 2.5 DeveloperHTML5 Export Module

    Join Date
    Jun 2006
    Posts
    1,469
    Mentioned
    10 Post(s)
    Tagged
    0 Thread(s)

    Re: MMF 2 - Odd Drag and Drop Behavior

    I just wonder if Clickteam could make this a property of an object so if it is turned on it would just work and no coding would be needed by us users.

    Example: Object can drag and drop
    Object cannot drag and drop

    This has to such a common practice it should be a property.

    Just like in Windows XP with the drag and dropping of files into folders. There is code in the OS that allows this to happen for certain objects. For example desktop icons can be toggled on or off on if movement is allowed.

    Same idea here.

  7. #7
    Forum Moderator Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module
    Sphax's Avatar
    Join Date
    Jun 2006
    Location
    Paris, France
    Posts
    4,454
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: MMF 2 - Odd Drag and Drop Behavior

    Not a bug at all. Sometimes you must program something in MMF... It's one thing that you must program. <img src="/center/images/graemlins/wink.gif" alt="" />

Similar Threads

  1. Drag and drop movement- force drop action
    By qenio in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 7th April 2013, 09:53 PM
  2. [BUG] Drag 'n Drop
    By tekila in forum Android Export Module Version 2.0
    Replies: 6
    Last Post: 20th September 2011, 08:40 AM
  3. Drag & drop without drag & drop object.
    By soloman in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 20th August 2011, 02:45 AM
  4. Drag n Drop
    By faeriebass in forum Multimedia Fusion 2 - Technical Support
    Replies: 14
    Last Post: 23rd July 2009, 07:23 PM
  5. Drag & Drop
    By 150542 in forum The Games Factory 2 - Technical Support
    Replies: 8
    Last Post: 8th April 2008, 09:36 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •