User Tag List

Results 1 to 3 of 3

Thread: Dragging and dropping objects from a group

  1. #1
    Clicker Multimedia Fusion 2SWF Export Module

    Join Date
    Sep 2006
    Location
    Palm Harbor, Florida
    Posts
    56
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Dragging and dropping objects from a group

    I'm working on a board game. I want to click and drag a piece and place it on a space on the board.
    Each game piece is part of a group (qualifier: Good). Each space on the board is part of another group (qualifier: Areas).

    How can I program it so that when I click on an object from the "Good" group (a game piece), I can drag it to an object from the "Areas" group (a board space),
    and the position of that game piece will be repositioned onto the position coordinates of the board space it was dragged to?

    Each game piece object has a distinct number in an alterable value of the object called "piece number",
    and each board space object has a distinct number in an alterable value of the object called "space number".

    e.g.: one might drag a game piece object with "piece number" alterable value of "3" to a board space object with "space number" alterable value of "14".

  2. #2
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export Module
    Konidias's Avatar
    Join Date
    Aug 2009
    Posts
    1,546
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Well when you click on a piece, you would flag it to indicate it can be dragged. Then you make another condition checking for mouse down and for that object being flagged. If so, then move that object's position relative to the mouse. This will get the dragging part accomplished.

    Then you set up another event that checks for mouse button release, along with that object being flagged, and then check that object's position in relation to the board game space. This could be done a ton of different ways... from overlap checks, to checking for the nearest board space compared to the x,y of the dragged piece, etc... You can figure out what works best.

    Then you just snap that piece to the board's x,y.. Depending on how you've set up your hot spots/action points, this could be very easy.

  3. #3
    Clicker Multimedia Fusion 2SWF Export Module

    Join Date
    Sep 2006
    Location
    Palm Harbor, Florida
    Posts
    56
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks. Flagging the object did the trick.

Similar Threads

  1. Dragging an event into the group problem
    By RayMarble in forum File Archive
    Replies: 0
    Last Post: 20th November 2010, 03:18 PM
  2. Dragging active objects with mouse.
    By keokeo in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 7th November 2010, 08:06 PM
  3. dragging and dropping objects in running program
    By jsoares in forum The Games Factory 2 - Technical Support
    Replies: 5
    Last Post: 26th April 2008, 08:45 PM
  4. Dragging objects
    By Skeets in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 23rd November 2007, 06:16 AM
  5. Dragging objects with Mouse
    By Tommy in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 28th January 2007, 08:51 PM

Posting Permissions

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