User Tag List

Results 1 to 7 of 7

Thread: Centering Graphical Score

  1. #1
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module

    Join Date
    Aug 2011
    Location
    Beverly Hills, CA USA
    Posts
    508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Centering Graphical Score

    For my non side-scrollers I usually center my graphical score (it uses a non-proportional font) using this algorithm:

    (Frame Width/2)+((X Right( "Score" )-X Left( "Score" ))/2)

    This works fine without any virtual real estate, but how would I calculate it out for a viewport? I have set the score to NOT follow the frame.

  2. #2
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export Module
    Konidias's Avatar
    Join Date
    Aug 2009
    Posts
    1,546
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Re: Centering Graphical Score

    So you mean for a scrolling game? Just turn off follow the frame and then put the score object in the center of your frame?

    Also if you can, just set the hotspot of your graphical score to the center of itself... that way you don't even have to do the second part of your calculation...

    You'd just figure out the center of your frame (if you had a 640px wide frame, it would be 320px) and place the object there in the editor. If the object's hotspot is center, it should be centered up.

  3. #3
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module

    Join Date
    Aug 2011
    Location
    Beverly Hills, CA USA
    Posts
    508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Centering Graphical Score

    I'm sorry, I am using the score object with Images and because the fonts are not proportional I have to calculate the width every time and center it. Not sure how to get the viewport coords.

  4. #4
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleSWF Export Module
    Konidias's Avatar
    Join Date
    Aug 2009
    Posts
    1,546
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Re: Centering Graphical Score

    If the object isn't scrolling, then it's always just real x/y values. So if you tell MMF to put an object at 100,100 and the object has follow the frame turned off, then that object will always appear at 100,100 on the screen (not the frame)

  5. #5
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module

    Join Date
    Aug 2011
    Location
    Beverly Hills, CA USA
    Posts
    508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Centering Graphical Score

    Okay, I want it to always be centered on the screen. I can't seem to get it to do this. How can I get the Viewport X1 and X2? The viewport being the visible part of the screen within my much larger Frame.

  6. #6
    Clickteam Clickteam
    Olivier's Avatar
    Join Date
    Jun 2006
    Posts
    3,000
    Mentioned
    9 Post(s)
    Tagged
    1 Thread(s)

    Re: Centering Graphical Score

    This should work:
    (X Left Frame + (X Right Frame - X Left Frame)/2) + ((X Right( "Score" ) - X Left( "Score" ))/2)

  7. #7
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module

    Join Date
    Aug 2011
    Location
    Beverly Hills, CA USA
    Posts
    508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Centering Graphical Score

    That worked perfect. Thanks!

Similar Threads

  1. Centering Counter Within Column
    By Jaklar in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 14th April 2013, 01:22 PM
  2. Centering Text Counters
    By Verbage in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 31st July 2012, 04:48 AM
  3. Centering sub-app regardless of screensize.
    By camelman in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 25th January 2010, 04:39 PM
  4. Centering Sub-App
    By Evoxe in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 23rd July 2009, 11:09 AM
  5. margins and centering
    By ajp in forum Vitalize
    Replies: 0
    Last Post: 23rd July 2008, 05:32 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
  •