Sign in to follow this  
joshcawthorne

Bitmap Text update overlaying over old text, rather than replacing

Recommended Posts

Hi all,

I'm trying to create a coin counter in my game, using a bitmap font. Everything displays fine, and the counter works, however when a player collects a new coin, rather than replacing the '0' with a '1', it shows a '1', but underneath you can still see a '0' visibly. I've tried several work around methods, including even doing an if statement checking how many coins and replacing it with plain text rather than replying on the var count, and using coinText.updateText();. Does anyone have any ideas? I'll leave my code sample below.

 

var crystalCount = 0;
var coinText;

//Skip down to the update section

coinText = this.game.add.bitmapText(20, 10, 'carrier_command',  "Crystals:" + crystalCount, 12);
coinText.updateText();

 

Screenshot_33.png

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.