User Tag List

Results 1 to 7 of 7

Thread: Centering Counter Within Column

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module
    Jaklar's Avatar
    Join Date
    Oct 2012
    Posts
    46
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Centering Counter Within Column

    Greets,

    The application I am creating requires several counters to display weather information. While I was able to track down the information to properly center a counter within a frame, I am unable to find any information as to how I would center the counter within a column.

    I basically have a left, right and middle column and would like my counter to properly center within each area, no matter what the value of the counter.

    Any ideas or tips on how to achieve this would be greatly appreciated.

  2. #2
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export ModuleSWF Export Module
    Skyhunter's Avatar
    Join Date
    Jan 2007
    Location
    Croatia
    Posts
    451
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The easiest way to center would be to use a string object to display the numbers instead of a counter, make them the same width as the columns and aligment to center. So basicly you dont have to have any code for centering them since they do that themselves.

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module
    Jaklar's Avatar
    Join Date
    Oct 2012
    Posts
    46
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I considered that, but the Counter allows me to use a custom font I have created, which won't work with the string object. I have tried in vain to get custom fonts to work via Xcode. So I either need to figure out custom fonts on iOS or get the counter object centered.

  4. #4
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export ModuleSWF Export Module
    Skyhunter's Avatar
    Join Date
    Jan 2007
    Location
    Croatia
    Posts
    451
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here, i made you an example how to center the counter, its not perfect and your font will need to have each number pretty much the same width for it to work proper.

    https://dl.dropboxusercontent.com/u/...terCounter.mfa

  5. #5
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export ModuleXNA Export Module
    ProdigyX's Avatar
    Join Date
    Jan 2011
    Posts
    1,194
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    To center a counter, you need to

    Set X-Position to "[Center X-Position] - ([Width of Largest Number]*[Number of Digits]/)2)".

    This is off the top of my head, but this should center any counter assuming the widths are within a few pixels of the max width.

  6. #6
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module

    Join Date
    Mar 2010
    Location
    Lier, Norway
    Posts
    276
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Desired X pos+(X Right( "Counter" )-X Left( "Counter" ))/2

    https://dl.dropboxusercontent.com/u/...41/Counter.mfa

  7. #7
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export Module
    Jaklar's Avatar
    Join Date
    Oct 2012
    Posts
    46
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thank you so much

    Thank you so much for the people who offered up examples. Exactly what I was looking for (centering counter relative to another object). Works like a charm!

Similar Threads

  1. What am i doing wrong? Centering a counter
    By Redsquirrel in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 23rd January 2013, 08:20 AM
  2. Centering a counter in the frame
    By Pineapple in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 24th December 2011, 09:16 PM
  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. Datagrid, add new column.
    By Gibbon in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 13th May 2009, 11:33 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
  •