Jump to content

Editing Sprite Pixels


sleepyVision
 Share

Recommended Posts

Hey all,

 

I'm trying to find a way to replace certain pixels of an image I've loaded as a sprite.  I've tried first loading into a BitmapData object and then creating the sprite from that, but the image is never drawn when I take that approach.  Not sure what I'm doing wrong.

 

Below is the relevant code; any help/advice would be appreciated,

var bmd = new Phaser.BitmapData(game, "archer", 32, 32);                                                         
bmd.replaceRGB(255, 0, 255, 255, r, g, b, 255, null);                     
 
sprite = new Phaser.Sprite(game, 0, 0, bmd); //doesn't work                                       
//sprite = new Phaser.Sprite(game, 0, 0, "archer");  //works 

 

 

 

Thank you!

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...