Jump to content

Replace colors in sprite


Recommended Posts


I need to replace the colors of a sprite during the game. More precisely, I need to swap specific colors with others (e.g., swap blue with red). I know that there is a method in BitmapData that does exactly what I need (replaceRGB). But I need to apply it to a sprite. Is it possible? Maybe if I could access the sprite's bitmapdata, I could do that. I know it is possible to replace colors using shaders, but I want to know if it is possible without shaders first.


Link to comment
Share on other sites

Thanks guys, but all examples in these pages assume you have access to bitmapdata independently of a sprite (at most, the sprite is created from bitmapdata, then, of course, you have the original bmd). Can I assume then that you can't extract the bmd from a sprite, and this is indeed the only way? (to create the sprite from bmd and keep the bmd)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

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