Aurora.ScriptEngine.AuroraDotNetEngine.APIs.LSL_Api.SetAlpha C# (CSharp) Method

SetAlpha() protected method

protected SetAlpha ( ISceneChildEntity part, double alpha, int face ) : void
part ISceneChildEntity
alpha double
face int
return void
        protected void SetAlpha(ISceneChildEntity part, double alpha, int face)
        {
            Primitive.TextureEntry tex = part.Shape.Textures;
            Color4 texcolor;
            bool changed = false;
            if (face >= 0 && face < GetNumberOfSides(part))
            {
                texcolor = tex.CreateFace((uint)face).RGBA;
                if (texcolor.A != alpha)
                    changed = true;
                texcolor.A = Util.Clip((float)alpha, 0.0f, 1.0f);
                tex.FaceTextures[face].RGBA = texcolor;
                if (changed)
                    part.UpdateTexture(tex, false);
            }
            else if (face == ScriptBaseClass.ALL_SIDES)
            {
                for (int i = 0; i < GetNumberOfSides(part); i++)
                {
                    if (tex.FaceTextures[i] != null)
                    {
                        texcolor = tex.FaceTextures[i].RGBA;
                        if (texcolor.A != alpha)
                            changed = true;
                        texcolor.A = Util.Clip((float)alpha, 0.0f, 1.0f);
                        tex.FaceTextures[i].RGBA = texcolor;
                    }
                }
                texcolor = tex.DefaultTexture.RGBA;
                if (texcolor.A != alpha)
                    changed = true;
                texcolor.A = Util.Clip((float)alpha, 0.0f, 1.0f);
                tex.DefaultTexture.RGBA = texcolor;
                if (changed)
                    part.UpdateTexture(tex, false);
            }
            part.ScheduleUpdate(PrimUpdateFlags.FullUpdate);
        }
LSL_Api