iDevGames Forums
grayscale loaded as gl_alpha: the opaque image can be only white? - Printable Version

+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Game Programming Fundamentals (/forum-7.html)
+--- Thread: grayscale loaded as gl_alpha: the opaque image can be only white? (/thread-8543.html)



grayscale loaded as gl_alpha: the opaque image can be only white? - sefiroths - Jan 14, 2011 02:23 AM

hi, i have a grayscale image loaded as gl_alpha:
1) where the image is black what is displayed is white
2) where the image is gray what is displayed is partially transparent
3) where the image is white what is displayed is fully transparent.
i'm wondering if the image that must be opaque (1) can be diaplyed with a different color instead of white
thanks


RE: grayscale loaded as gl_alpha: the opaque image can be only white? - Skorche - Jan 14, 2011 07:22 AM

Change the drawing color before drawing the texture. (i.e. glColor*() or sprite.color in Cocos2D)


RE: grayscale loaded as gl_alpha: the opaque image can be only white? - sefiroths - Jan 14, 2011 08:06 AM

very nice!
thanks