User Tag List

Results 1 to 3 of 3

Thread: X and Y to Single number and reverse

  1. #1
    No Products Registered

    Join Date
    Sep 2006
    Location
    Malmesbury, UK
    Posts
    38
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    X and Y to Single number and reverse

    Is there a way of converting X value and Y value to a Single Value and then reverse? I need to send the positions in 1 value.

    Plooscva

  2. #2
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: X and Y to Single number and reverse

    Well, one way to do it is to multiply the X value by the maximum value that Y can be, then adding the Y to it (or the other way round). This gives a continuous series of unique values...

    For example, if your frame is 640x480:

    X=50, Y=100 ... Combined value = 50*480 + 100 = 2500
    X=47, Y=479 ... Combined value = 22560 + 479 = 23039

    (In total, 307,200 positions are possible in 640x480.)

    To get it back, the X is the result of dividing the combined value by the maximum value of Y, and the Y is the remainder.

    23039 / 480 = 47 r 479

  3. #3
    No Products Registered

    Join Date
    Sep 2006
    Location
    Malmesbury, UK
    Posts
    38
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: X and Y to Single number and reverse

    Ok I found a way to work round but still this will come in helpful one day. Cheers

Similar Threads

  1. Getting a random number between a negative and positive number
    By D_Light in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 9th January 2013, 10:51 PM
  2. strage bug: doing reverse?
    By Chokito in forum SWF/Flash Export Module Version 2.0
    Replies: 4
    Last Post: 10th August 2011, 09:02 AM
  3. Reverse Division
    By izac in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 6th April 2009, 01:29 PM
  4. Reverse Text
    By Atom in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 11th March 2009, 06:56 PM
  5. Reverse keys
    By the_raven in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 17th October 2006, 02:31 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
  •