User Tag List

Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 22

Thread: Drag to rotate an object.

  1. #1
    No Products Registered

    Join Date
    Jul 2009
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Drag to rotate an object.

    hi,
    This is my first post here.I am using a demo version of MMF2 and have found the posted tutorials a great help.
    Now I have a question regarding dragging and rotating an object. Is it possible to drag and rotate an object about its hotspot? I mean is it possible to click on an object(a circle to be exact) and while the mouse button is pressed, the object rotates about its centre? When the mouse button is not pressed, the object stops.

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export ModuleUnicode Add-on
    Looki's Avatar
    Join Date
    Aug 2006
    Location
    Karlsruhe, Germany
    Posts
    3,741
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)

    Re: Drag to rotate an object.

    Hello. That's very easy to do There's an action "Set angle" in "Scale / Angle". You can also get the angle in the expression menu.

    Do something like
    Set angle to Angle("Active")+5
    to rotate it continuously.

  3. #3
    No Products Registered

    Join Date
    Jul 2009
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Drag to rotate an object.

    Thank you so much for taking the time to answer my question.
    But I sort of already could do this. My specific problem is to sort of create the illusion that when the player presses the mouse button down and moves the button on the object, it appers as if the mouse is slowly rotating the object by dragging it around the centre.
    I really hope this can be done. And thanks again for answering my question.

  4. #4
    Clicker Fusion 2.5 DeveloperiOS Export Module
    Czentnar's Avatar
    Join Date
    Jan 2007
    Location
    Budapest, Hungary
    Posts
    819
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Drag to rotate an object.

    You can set the angle depending on the mouse position:
    ATan(XMouse-X("Active"), YMouse-Y("Active"))
    (I hope it's ATan - it's the arc tangent expression)

  5. #5
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export ModuleUnicode Add-on
    Looki's Avatar
    Join Date
    Aug 2006
    Location
    Karlsruhe, Germany
    Posts
    3,741
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)

    Re: Drag to rotate an object.

    Ah, yes, I was unsure if it's that what you wanted.

    I'm going to extend Czentnar's code here - his would always reset the angle to 0 before rotating.

    While the mouse is not pressed,
    Set alterable value A to Angle("Active")
    While the mouse is pressed,
    Set the angle to Alterable value A("Active")+ATan2(XMouse-X("Active"), YMouse-Y("Active"))

    It's Atan2.

  6. #6
    Clicker Fusion 2.5 DeveloperiOS Export Module
    Czentnar's Avatar
    Join Date
    Jan 2007
    Location
    Budapest, Hungary
    Posts
    819
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Drag to rotate an object.

    Yes, it's ATan2... thanks Looki, your code is better!

  7. #7
    No Products Registered

    Join Date
    Jul 2009
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Drag to rotate an object.

    Thank you so much guys. Looki and Czentnar, you are absolutely awesome and very generous. :grin: :grin: :grin:

  8. #8
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    OldManClayton's Avatar
    Join Date
    Aug 2006
    Posts
    193
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Drag to rotate an object.

    You know, I spent a good hour yesterday trying to make one that did not reset the angle. I KNOW I tried that exact setup (plus many many others) but it never worked. :S

    Ah well, I probably missed something. Thanks for the info, Looki!

  9. #9
    No Products Registered

    Join Date
    Jul 2009
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Drag to rotate an object.

    Hey guys,
    Its me again.Ran into another problem.
    I followed the instrustion the way it is posted here and it works beautifully except for a little problem.Everytime the player clicks on the object to rotate it, it sort of jumps forwards a few degrees and then starts to rotate.
    Is there a solution to this?
    Thanks in advance.

  10. #10
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export ModuleUnicode Add-on
    Looki's Avatar
    Join Date
    Aug 2006
    Location
    Karlsruhe, Germany
    Posts
    3,741
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)

    Re: Drag to rotate an object.

    Hey. Not sure - maybe you set the alterable value after setting the angle? Try swapping the event order!

Page 1 of 3 1 2 3 LastLast

Similar Threads

  1. Rotate toward object?
    By Outcast in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 5th July 2013, 02:53 PM
  2. Help Please... Need to Rotate Rotate object with a wheel
    By Tuna in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 12th February 2012, 04:48 PM
  3. Rotate towards and shortest rotate direction
    By Tiles in forum File Archive
    Replies: 19
    Last Post: 2nd October 2010, 02:25 PM
  4. Drag to rotate an object.
    By Czentnar in forum File Archive
    Replies: 3
    Last Post: 26th July 2009, 10:22 PM
  5. Rotate at object
    By jellytot in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 2nd January 2007, 06:55 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
  •