In-Game Image coloration, how?
by Robert Fritzen · in Torque 3D Professional · 07/16/2011 (1:32 pm) · 3 replies
Since source code is more than likely necessary here, I have a few questions regarding images.
So, lets say I have some image files. And with these images, I would like to be able to change the color of these images in my game using the color select gui.
All of the images are pure white with transparent backgrounds, so I would assume a color fill would probably work? Question is, how would I do this?
So, lets say I have some image files. And with these images, I would like to be able to change the color of these images in my game using the color select gui.
All of the images are pure white with transparent backgrounds, so I would assume a color fill would probably work? Question is, how would I do this?
About the author
Illinois Grad. Retired T3D Developer / Pack Dev.
Associate Chris Haigler
Jester Dance
Edit: Tinkered around for a couple of minutes and modified the GuiBitmapCtrl class to allow modulation color changes to be set from script. Modified GuiBitmapCtrl here: Link
Adds two new script methods to GuiBitmapCtrls: setColor() and getColor(). setColor takes a ColorI in the form of: "r g b alpha" (i.e. myImage.setColor("255 0 255 255");). getColor() simply returns the current modulation color (i.e. myImage.getColor();).