• Content Count

  • Joined

  • Last visited

  1. Thanks, that really helped. I think the issue I was having was not clearing the context before I updated the bar and getting messed up with positioning the bitmapdata. I think I was rendering it off screen or something, I thought the arguments in this.add.bitmapData() had to be the width & height of the game.
  2. I want to use bitmapdata to draw a bar to be used as a visual countdown timer (and later for health bars). I can't seem to get anything to draw on screen. Following this example as best I can. In my create() function ! have this.powerup1_bar = this.add.bitmapData(this.width, this.height);this.powerup1_bar.context.fillStyle = '#fff';// Add the bmd as a texture to an Image object.// If we don't do this nothing will render on screen.this.add.sprite(0, 0, this.powerup1_bar);and in my function that is looped by my timer this.powerup1_bar.context.fillRect(10, 510, 20 * this.powerup1_remaining, 20);where this.powerup1_remaining is an integer decremented by 1 every second. I can draw this number to the screen but not a rectangle representing it.