User Tag List

Results 1 to 8 of 8

Thread: pick sprite with mouse

  1. #1
    No Products Registered

    Join Date
    Feb 2009
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    pick sprite with mouse

    Hi,
    i'm beginner in MMF2Dev, i'm trying make the mouse pick small sprite with one click(make sprite coordinate = mouse coordinates), this is my mmf2dev file:

    http://www.geocities.com/mfa.online/01.zip

    the problem, when i click the sprite jump to another position
    i hope some help

    regards
    mfa




  2. #2
    Clicker Fusion 2.5 Developer

    Join Date
    Jan 2007
    Location
    USA
    Posts
    691
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: pick sprite with mouse

    So, you want a new Active Object to be created every time someone clicks?

    Just create a new object and make it go to cursor positions. Have Create Active before the position events.

  3. #3
    No Products Registered

    Join Date
    Feb 2009
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: pick sprite with mouse

    ok, i succeed in making mouse drag sprite by click it, but there is still small problem, when mouse dragging the sprite, the sprite appear under mouse cursor not exact under mouse cursor..how can solve that..?
    this is my file i update it..

    http://www.geocities.com/mfa.online/01.zip

  4. #4
    Forum Moderator

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export ModuleInstall Creator Pro
    nivram's Avatar
    Join Date
    Jul 2006
    Location
    Bandon, Oregon
    Posts
    6,773
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)

    Re: pick sprite with mouse

    Maybe if you change the hot spot on your sprite?
    ​458 TGF to CTF 2.5+ Examples and games
    http://www.castles-of-britain.com/mmf2examples.htm

  5. #5
    Clicker Fusion 2.5 Developer

    Join Date
    Jan 2007
    Location
    USA
    Posts
    691
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: pick sprite with mouse

    Just make the position to XMouse+16 and YMouse+16

  6. #6
    No Products Registered

    Join Date
    Jul 2006
    Posts
    2,289
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)

    Re: pick sprite with mouse

    There is an Active Dragger Widget that has the calculations in it for getting your sprite to pick up from exactly where the mouse pointer is:

    http://theclickteam.com/epicenter/ubbthreads.php?ubb=showflat&Number=65849#Post65849

    Look in the Behavior and there you go.

  7. #7
    Clicker Fusion 2.5 Developer

    Join Date
    Jan 2007
    Location
    USA
    Posts
    691
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: pick sprite with mouse

    Ohhh. He wants to be able to drag the sprite.

    Wow, I was totally lost.

  8. #8
    Clickteam Clickteam

    Join Date
    Jun 2006
    Location
    California, USA
    Posts
    1,247
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)

    Re: pick sprite with mouse

    You can do this without an additional object like this: (as found using the search feature of the forum)

    Upon Clicking on Object:
    Set Object Value A to (XMouse - Object Position
    Set Object Value B to (YMouse - Object Position Y)
    Set Object Flag 0 On

    While Object Flag 0 is On
    Set Object Position X to (XMouse - Value A)
    Set Object Position Y to (YMouse - Value B)

    (NEGATE) While left click is repeated:
    Set Object Flag 0 Off

    As you can see the first event records the difference of the mouse position and the objects position, and sets the flag to ON. The second event, using the flag ON action from the first event, moves the object to the current mouse position and subtracts the offset stored in the alternate values. Lastly, the third event detects when the user releases the mouse button and sets the flag to OFF which means the second event is no longer true. The whole thing is repeated when the user clicks, and holds, the mouse on the object again.
    DT
    Special Projects Director

Similar Threads

  1. Bug (mouse is gone) Sprite/image
    By DJ_Wild in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 1st February 2010, 07:01 PM
  2. Top active pick with the mouse
    By nivram in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 7th June 2008, 02:51 PM
  3. Mouse Movement prevents mouse click event?
    By Tuna in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 2nd March 2008, 02:52 AM
  4. Mouse click events runs faster when mouse moves
    By chrilley in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 2nd February 2007, 02:54 PM
  5. Mouse click doesnt work when Mouse movement used
    By Blizna in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 21st September 2006, 02:24 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
  •