Author Topic: Changing size of FlxSprite graphic at <1 pixel per frame  (Read 825 times)


  • New Member
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
I need to change the height of the player avatar (an instance of a FlxSprite custom subclass) gradually, which I'm doing by changing the height value in the update loop and then calling makeGraphic(width, height, etc...).

First question: can anyone suggest a better/cheaper way of doing this?

Second question: this method does not allow decrementing height by less than 1 pixel per update call, because of the way makeGraphic is implemented. To circumvent this, I made the following change to the makeGraphic implementation:

Code: [Select]
frameWidth = _pixels.width; //width = frameWidth = _pixels.width;
frameHeight = _pixels.height; //height = frameHeight = _pixels.height;

Will this mess things up / can anyone suggest a cleaner solution?