SetAlpha() public method

Updates the alpha value of all vertices.
public SetAlpha ( float alpha ) : void
alpha float
return void
コード例 #1
0
        public void TestSetAllAlphas()
        {
            VertexData vertexData = new VertexData(4);
            vertexData.SetAlpha(0.5f);

            for (int i = 0; i < vertexData.NumVertices; ++i)
            {
                AssertAreEqualWithSmallError(0.5f, vertexData.AlphaAt(i), "wrong alpha", 0.005f);
            }
        }
コード例 #2
0
        public void TestSetAllColorsAndAlphas()
        {
            uint color = 0xabcdef;
            float alpha = 0.5f;
            VertexData vertexData = new VertexData(4);
            vertexData.SetColor(color);
            vertexData.SetAlpha(alpha);

            for (int i=0; i<vertexData.NumVertices; ++i)
            {
                Assert.AreEqual(color, vertexData.ColorAt(i), "wrong color");
                AssertAreEqualWithSmallError(alpha, vertexData.AlphaAt(i), "wrong alpha", 0.005f);
            }
        }