Game Development Community

Adding a mask to the bitmal button control

by Joel Reymont · in Torque Game Builder · 05/10/2005 (8:11 am) · 0 replies

Folks,

I need to add a mask to guiBitmapButtonCtrl. I understand that it uses different files for each button state. I would like to use a single mask file for all bitmaps since the shape is the same. I modified Torque to use a mask image if one exists and is named *.alpha.png. There is some code in gTexManager.cc (look for loadInstance and thanks to Melv May) to do this but it means that I would need to duplicate the mask for each button state.

Is there a known hook in T2D to make setting alpha from a mask file easy?

I suppose I can just copy the code from gTexManager.cc into a separate function and then create a new texture right after obtaining the original one here:

dStrcpy(p, "_n");
mTextureNormal = TextureHandle(buffer, BitmapTexture, true);

Is there an easier way, though?

Thanks, Joel