Hide digits in custom score font

EagleoneEagleone Member Posts: 97
edited November -1 in Working with GS (Mac)
I used TB's "custom font score counter" in my project but I am wondering how to hide the numbers which are not in use? I have 6 zeros displayed, if the score is a 100 it will look like this --> 000100. How do I make it so it displays only 100 without the 000 infront?

Comments

  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    On each digit set a rule

    If game.score is less than xxxx
    --Change self.alpha to 0
    Otherwise
    --Change self.alpha to 1

    xxxx needs to be what ever value the minimum that digit will be visible.

    edit: @QS - take that :P
  • quantumsheepquantumsheep Member Posts: 8,188
    Put in each digit:

    If score is greater than 1000, say, then set alpha to 1 otherwise set alpha to 0.

    The 1000 would be used for your 4th digit from the right.

    100000 would be used for your fifth digit with a 'if score is greater than 10000' for example.

    Essentially, make each digit visible as and when the score needs them!

    Make sense?

    QS :D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • quantumsheepquantumsheep Member Posts: 8,188
    Bah! Beaten! :O

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • EagleoneEagleone Member Posts: 97
    Yep understood, thanks guys but just let me confirm one thing. Say I have 4 digits (0000). If I want to hide the 1st digit from the left I would input the following in the 2nd digit from the left right?

    If game.score is less than 1000
    --Change self.alpha to 0
    Otherwise
    --Change self.alpha to 1
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    No that would be the code that goe into the 1st digit from the left.

    If you put the in the second digit from the left it would not show up 100-999
  • EagleoneEagleone Member Posts: 97
    I mean input the code in the 1st digit from the left.
  • EagleoneEagleone Member Posts: 97
    Yep yep, very well explained fellas, thank you very much!
  • quantumsheepquantumsheep Member Posts: 8,188
    Eagleone said:
    Yep understood, thanks guys but just let me confirm one thing. Say I have 4 digits (0000). If I want to hide the 1st digit from the left I would input the following in the 2nd digit from the left right?

    This confuzzled me for a minute! Careful how you write stuff! :D

    Your second digit (of four) from the right would count the 100s. The third the 10s. The fourth the 1s.

    So you take the lowest figure for each of those.

    For the second from the right:

    If score is greater or equal to 100

    Third from right:

    If score is greater or equal to 10

    Fourth from right:

    If score is greater or equal to 1

    Hope that helps!

    QS :D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • EagleoneEagleone Member Posts: 97
    LOl, sorry quantum, it fuzzled me as well just by reading it again. When you know that you can't understand your own writing anymore then you know you got some real problems lol. All good now though, I understand what needs to be done.

    Thanks again for the clear explanation buddy.
Sign In or Register to comment.