Custom font not working?
PBEmpire
Member Posts: 676
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.
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
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.
So which rule should i use? Change att or constrain att?
Edit: now all my number actors just show up as a square box..
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?