Spherical forums

Sphere Development => Sphere Support => Script Support => Topic started by: williammah on November 16, 2013, 09:41:01 am

Title: Replace color in-game
Post by: williammah on November 16, 2013, 09:41:01 am
Is it possible to change a color of an image in-game? Like, this PNG image which is all green, I want to change the green to white transparent. I cant seem to see any function of that sort in the functions list..
Title: Re: Replace color in-game
Post by: Radnen on November 16, 2013, 12:39:35 pm
Cast an image to a surface with image.createSurface(). Then use surface.replaceColors(Col_A, Col_B). And finally cast it back with surface.createImage().