ScaleAlphaBy() public méthode

Multiplies all alpha values with a certain factor.
public ScaleAlphaBy ( float factor ) : void
factor float
Résultat void
        public void TestScaleAlphaWithPMA()
        {
            VertexData vertexData = new VertexData(1, true);

            vertexData.SetColor(ColorUtil.GetRGB(80, 60, 40), 204/255.0f);

            vertexData.ScaleAlphaBy(0.8f);

            CompareVertexColor(VertexColorHelper.CreateVertexColor(
                (byte)(80 * 0.64f + 0.5f), 
                (byte)(60 * 0.64f + 0.5f), 
                (byte)(40 * 0.64f + 0.5f), 
                (byte)(204 * 0.8f + 0.5f)), vertexData.VertexColors[0]);
        }
        public void TestScaleAlphaWithoutPMA()
        {
            VertexData vertexData = new VertexData(1);

            vertexData.SetColor(ColorUtil.GetRGB(80, 60, 40), 128/255.0f);

            vertexData.ScaleAlphaBy(0.5f);

            CompareVertexColor(VertexColorHelper.CreateVertexColor(80, 60, 40, 64), vertexData.VertexColors[0]);
        }