Clandestine.Texture.GetTexture C# (CSharp) Method

GetTexture() public static method

public static GetTexture ( string name ) : Texture
name string
return Texture
        public static Texture GetTexture(string name)
        {
            string lname = name.ToLower();

            lock (textures)
            {
                if (textures.Keys.Contains(lname))
                    return textures[lname];
                else
                {
                    if (File.Exists(name))
                        return new Texture(name);
                    else
                    {
                        Log.e("Texture.GetTexture(): No file with name '" + name
                            + "' exists on disk!");
                        return Texture.GetTexture("error.png");
                    }
                }
            }
        }

Usage Example

示例#1
0
        public static Texture GetTexture(string name)
        {
            string lname = name.ToLower();

            lock (textures)
            {
                if (textures.Keys.Contains(lname))
                {
                    return(textures[lname]);
                }
                else
                {
                    if (File.Exists(name))
                    {
                        return(new Texture(name));
                    }
                    else
                    {
                        Log.e("Texture.GetTexture(): No file with name '" + name
                              + "' exists on disk!");
                        return(Texture.GetTexture("error.png"));
                    }
                }
            }
        }
All Usage Examples Of Clandestine.Texture::GetTexture