User Tag List

Results 1 to 3 of 3

Thread: "Arrange by" order objects by value (minimal/no extensions)

  1. #1
    Clicker Fusion 2.5 DeveloperFusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleXNA Export Module
    DistantJ's Avatar
    Join Date
    Jan 2008
    Location
    Gloucester, UK
    Posts
    2,144
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    "Arrange by" order objects by value (minimal/no extensions)

    OK here's an interesting one,

    I am detecting the distance between two points - think of it as the distance of multiple objects from the central point/player. Now, I can store the distance between the 'player' and each object in one of that object's alterable values, which is great. However, I'd like to 'sort' them by which one is the closest, to which is the furthest away. Say, the closest one should be assigned a value of 1, the second closest a value of 2, etc. etc. so that I can sort them accordingly. This is for iOS, Android and other formats, so I can't really be using extensions which aren't compatible.

    All I can think is to keep repeating a loop, then when the object's 'distance' value is equal to the loop index, to set its 'order' value to that of another counter, and add 1 to that counter, repeatedly until all of the objects have been given an 'order' value. Problem with this method is I don't know where to make the loop stop (unless there's away to find the highest alterable value), and a large fastloop like this could cause serious problems on the mobile platforms.

    Any suggestions?

  2. #2
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export ModuleUnicode Add-on

    Join Date
    Jun 2006
    Location
    Australia
    Posts
    988
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Edit: I didn't check the extensions first. But the Layer object is available on iOS and Flash, so you should try to use that if possible. My solution below uses the Select Object extension, just for anyone who is curious for how it might be used:

    The Select Object extension allows you to select an active object with the highest/lowest alterable value. So what I would do is combine this with a loop for the number of objects + a "done" variable in the active itself.

    For example, when you want to order them, do this:

    >Set Active.done to 0
    >Start loop "order" for Number of Active loops

    On loop "order"
    Active.done = 0
    Select single Active with lowest Alt value
    >bring to back
    >set active.done = 1

  3. #3
    Clicker Fusion 2.5 DeveloperFusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleXNA Export Module
    DistantJ's Avatar
    Join Date
    Jan 2008
    Location
    Gloucester, UK
    Posts
    2,144
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Like you said, the Select Object is compatible with iOS, but I never thought to check the layer object for this feature.

    I suppose I could do 'sort by alterable value' and then do a 'spread value', since last time I checked the spread value went from the object at the back to the object at the front.

    Your method makes perfect sense though, thanks!

Similar Threads

  1. "3d" object order question (MFA included)
    By Aloan in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 17th October 2012, 01:08 AM
  2. "Arrange by" order objects by value
    By DistantJ in forum iOS Export Module Version 2.0
    Replies: 0
    Last Post: 23rd February 2012, 11:40 PM
  3. help with order "bring object to front"
    By willow in forum SWF/Flash Export Module Version 2.0
    Replies: 3
    Last Post: 12th May 2011, 12:17 PM
  4. "Path Find" & "Advanced Path Movement" extensions
    By kikiriki in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 8th April 2010, 08:59 PM
  5. Determine distance from objects ("A" to "B")
    By Oreo in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 4th April 2010, 02:47 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
  •