User Tag List

Results 1 to 3 of 3

Thread: Problems with scaling

  1. #1
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    Yima's Avatar
    Join Date
    Feb 2008
    Location
    Sweden
    Posts
    104
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Problems with scaling

    Hi - this is my first post on these forums. I am currently working on a sort of RPG/platform hybrid game, in which the main character is supposed to have mana to spend on spells. I want to display a mana bar on top of the screen.

    The maximum amount of mana is not fixed, but based on the main characters level. To display the mana, I have created an active object in form of a horizontal bar. My thought is that I can control this mana bar by setting its hot spot on the left side of the bar, and always setting:

    XScale to mana("player")/maxmana("player")

    Mathematically, this should produce a number between 0 and 1, as long as I make sure that the players mana cannot exceed the maximum mana.

    However, when I try this out, the mana bar disappears. My theory is that MMF2 makes the calculation mana/maxmana, and sets the mana bar XScale to the integer value of the result. This value is of course always 0, unless mana=maxmana.

    I don't know if that is what happens, or if something else is wrong. I would, in either case, be very thankful for any solution to how to do this properly. Note that I do not want to use a counter set to display as a bar, since counters have a tendency to flicker when the screen scrolls.

  2. #2
    No Products Registered

    Join Date
    Aug 2006
    Posts
    984
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Problems with scaling

    yes, MMF does integer division unless you force it to use floats, so try:

    (mana("player")*1.0)/maxmana("player")

  3. #3
    Clicker Fusion 2.5 DeveloperiOS Export ModuleSWF Export Module
    Yima's Avatar
    Join Date
    Feb 2008
    Location
    Sweden
    Posts
    104
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Problems with scaling

    Quote Originally Posted by xyzzy
    yes, MMF does integer division unless you force it to use floats, so try:

    (mana("player")*1.0)/maxmana("player")
    Thanks a bunch - this solved my problem perfectly. I was trying to use floats, but didn't know the syntax (so I tried things like float(mana("player)), which obviously didn't work at all :P). Now the mana bar works as intended.

Similar Threads

  1. scaling
    By Skyhunter in forum SWF/Flash Export Module Version 2.0
    Replies: 9
    Last Post: 20th March 2013, 07:31 AM
  2. Scaling app down
    By Keith in forum SWF/Flash Export Module Version 2.0
    Replies: 8
    Last Post: 25th February 2012, 06:40 PM
  3. Scaling
    By nivram in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 17th September 2010, 11:53 PM
  4. Scaling
    By TreeHugger in forum File Archive
    Replies: 3
    Last Post: 10th April 2008, 05:08 PM
  5. Scaling
    By Raphael in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 14th September 2006, 08:17 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
  •