User Tag List

Results 1 to 2 of 2

Thread: More than one action point

  1. #1
    Clicker Fusion 2.5 Developer

    Join Date
    Nov 2008
    Posts
    299
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    More than one action point

    So I made a little example of how to add more than one action point to an object.
    This example uses no extensions, stores the value in one action, and snaps the point into place with one "always".

    The idea is that when you click, the point is created - however, instead of working with complex transformations for angle changes, you store the position relative to the main object.

    When you create the object, you need to measure two things: the angle of the point in relation to the mouse, and the distance of the point in relation to the hot spot of its parent object - that's all you need.

    The angle is given by:
    [color:#663333]ATan2((Y position of the Mouse - Y position of the parent), (X position of the parent -X position of the mouse))+(180 - Angle of the parent)[/color]
    Note 1: Don't forget the comma in the expression above!
    Note 2: You need to subtract the angle of the parent to 180, because of some weird issues with angles in mmf


    The distance is given by:
    [color:#663333]Sqr((X position of the parent - X position of the mouse)²+(Y position of the parent - Y position of the mouse)²)[/color]
    Use ### pow 2 instead of ###²

    Note: you don't have to create an object to store this information, you can store them into the alterable values of the object itself or somewhere else, such as a file or array

    When setting the point's position, you set it's X coordinate to
    [color:#663333]X position of parent + cos(angle of the point + angle of the ship)*(distance of the point to the center of the object)[/color]
    and it's Y coordinate to
    [color:#663333]Y position of parent - sin(angle of the point + angle of the ship)*(distance of the point to the center of the object)[/color]
    Attached files Attached files

  2. #2
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    RickyRombo's Avatar
    Join Date
    Mar 2008
    Location
    Somewhere between here and there
    Posts
    3,167
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: More than one action point

    Great article!

    I have a suggestion though - you can multiply by the scale of the parent as well:

    X position of parent + cos(angle of the point + angle of the ship)*(distance of the point to the center of the object)*XScale("parent")

    etc

Similar Threads

  1. Need help with action point
    By Cryonaut in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 11th December 2010, 06:16 AM
  2. Rotation Action Point Bug!
    By dustingunn in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 20th September 2006, 10:23 PM
  3. Shoot + Point d'action
    By Yves in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 6th July 2006, 03:36 PM
  4. Action Point(s)
    By konjak in forum Multimedia Fusion 2 - Technical Support
    Replies: 11
    Last Post: 3rd July 2006, 03:12 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
  •