Custom font not working?

PBEmpirePBEmpire Member Posts: 676
edited May 2013 in Working with GS (Mac)
Not sure why but i am pretty sure my rules are correct yet custom font numbers are not working. Here are my rules:

When actor overlaps/collides with coin, change attribute game.coin to game.coin + 1.

(In number actor)- Constrain attribute- self.image to floor((game.coin%self.divisor)/(self.divisor/10))..".png"

The number just does not change although the coin attribute is changing when i created a display text actor to see if that was the problem.Sometimes, the number just glitches up and changes after a 10-15 seconds, and sometimes nothing happens.

Comments

  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    edited May 2013
    drop the .png you don't need it
    don't use %, use mod(game.coin,self.divisor)
    try this instead. mod(floor(game.coin/self.divisor),10)
    your self.divisor values would be 1,10,100,1000,etc

    Although, if you have multiple coins being gathered and they don't get destroyed/moved fast enough, the actor colliding with multiple coins at the same time would not see a new event to trigger incrementation of the coin attribute. You would want the coin to increment the attribute instead.
  • PBEmpirePBEmpire Member Posts: 676
    edited May 2013
    @CodeMonkey
    So which rule should i use? Change att or constrain att?

    Edit: now all my number actors just show up as a square box..
  • PBEmpirePBEmpire Member Posts: 676
    @CodeMonkey
    I added the ..".png" at the end of the expression and it worked. Is there a reason why you asked me to not use it?
  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    Its not supposed to need the .png, but I guess if it works, go for it. The engine was modified at one point where the .png was taken off of xml references.
Sign In or Register to comment.