User Tag List

Results 1 to 9 of 9

Thread: Random position on screen

  1. #1
    Clicker Multimedia Fusion 2

    Join Date
    Mar 2007
    Location
    I'm right here!!
    Posts
    305
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Random position on screen

    What terminology is used to select a random x, y position on screen? I know it's done through the expression calculator but I don't know the correct phrase.

    Also, is there a list of things that can be put in the expression calculator? something like:

    RANDOM(x)
    -------------
    This will produce a random number between 0 and x. So RANDOM(3) will produce a random number between 0 and 2. RANDOM(3)+1 will produce the correct random number between 1 and 3.

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS 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)
    Popcorn's Avatar
    Join Date
    Jun 2006
    Location
    Norway, Bergen
    Posts
    2,356
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)

    Re: Random position on screen

    For your first question you allready have the answer right there...

    If the width of the window is 640 and you want to place an object anywhere in between, simply set the x-position of the object to Random(640). If you want to have some space at the edges you don't want the objects to appear, do X + Random(640-X*2)

    I don't know about any page that list up every type of expression in MMF2, but all of them are availible from the icons in the expression editor. For instance you find "Random" from the Special icon.

  3. #3
    Clicker Multimedia Fusion 2

    Join Date
    Mar 2007
    Location
    I'm right here!!
    Posts
    305
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Random position on screen

    X + Random(640-X*2)

    That's exactly the syntax I was looking for Popcorn. Being new I didn't know if it had to be "player.x...." or "X(player)..." or something like that.

    Pity there isn't a reference list but I'm now going to create one! If anyone's willing to help that would be great.

  4. #4
    No Products Registered

    Join Date
    Feb 2007
    Posts
    199
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Random position on screen

    If you didn't know the size of the frame because say it changes sizes at runtime, you could also do:

    X + Random(frame width-x*2)

    and if you didnt want it to be below a certain point you could do:

    Min(640,Max(0,(Random(frame width)+100)))

    where min(value,value) always picks the minimum value and max(value, value) always picks the maximum value.




  5. #5
    Clicker Multimedia Fusion 2

    Join Date
    Mar 2007
    Location
    I'm right here!!
    Posts
    305
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Random position on screen

    Thank you so much guys, that's great! I've now got those answers in my Q&A text file so I won't forget.

  6. #6
    Clicker Fusion 2.5 Developer

    Join Date
    Jun 2006
    Location
    Hampshire, UK
    Posts
    963
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Random position on screen

    "Pity there isn't a reference list but I'm now going to create one!"

    Bare in mind the whole point of MMF is that you don't have to know all the 'language', everything you want is under the "Retrieve data from object" button.

  7. #7
    Clicker Multimedia Fusion 2

    Join Date
    Mar 2007
    Location
    I'm right here!!
    Posts
    305
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Random position on screen

    Perhaps I won't create a reference guide but a simple Q&A text file instead.

  8. #8
    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: Random position on screen

    Stick it on the Wiki - that could be quite helpful.

  9. #9
    Clicker Multimedia Fusion 2

    Join Date
    Mar 2007
    Location
    I'm right here!!
    Posts
    305
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Random position on screen

    How do you add to the wiki?

Similar Threads

  1. Random Loot Position Bug
    By Top_of_the_Temple in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 1st September 2013, 11:14 PM
  2. Screen position relative to taskbar position?
    By Raylax in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 2nd April 2009, 08:55 PM
  3. Random position a created object
    By Rabagast in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 29th June 2008, 11:08 AM
  4. a doubt about random position
    By mare in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 5th April 2008, 12:37 AM
  5. Random Position
    By dingdong in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 17th February 2007, 10:50 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
  •