climber

Change texture color

Recommended Posts

Total pixi noob here. 

I'm loading in a texture from an image file and need to dynamically change its color. The image is basically a flat wave-like shape that I want to be able to make different colors dynamically. I tried tinting a sprite but that only tints and doesn't make the color 100% opaque. 

What's the proper way to do this? Some sort of filter? I figure the answer to this is really simple, but I've poked around the API and am not seeing it. Thanks for any help!

Share this post


Link to post
Share on other sites

Yeah.  I don't know what the wave image is, but for mine, I use a white png image usually, and then set the tint to give it a color.  I get the tint off of gimp color picker, but have to set the first two digits to 0x and then the 16 digit numbers, like 0xFFFFFF.

Share this post


Link to post
Share on other sites

Sweet, this totally works! I tried tinting before from a colored graphic which yielded weird results. Having a white base image works perfectly though.

Really appreciate your help! Thank you.

Share this post


Link to post
Share on other sites

@fire7side you rock

@climber

There are a number of ways of changing colors of picture, different shader and blendmodes (not all of blendmodes are possible in webgl). If you want to do something, first post how exactly do you think that thing must convert single pixel, then find the name of that effect :)

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

  • Recently Browsing   0 members

    No registered users viewing this page.