protected ManualTextureMask ( Microsoft.Xna.Framework.Graphics.Texture2D &Texture, Color ColorFrom ) : void | ||
Texture | Microsoft.Xna.Framework.Graphics.Texture2D | The texture on which to apply the mask. |
ColorFrom | Color | The color to mask away. |
리턴 | void |
protected void ManualTextureMask(ref Texture2D Texture, Color ColorFrom)
{
Color ColorTo = Color.Transparent;
Color[] data = new Color[Texture.Width * Texture.Height];
Texture.GetData(data);
for (int i = 0; i < data.Length; i++)
{
if (data[i] == ColorFrom)
data[i] = ColorTo;
}
Texture.SetData(data);
}