Ejemplo n.º 1
0
        /// <summary>
        /// Constructs a drawable object using the given key.
        /// </summary>
        public IDrawable Create(string key)
        {
            // Get the tile
            Tile tile = null;

            try
            {
                tile = tiles[key];
            }
            catch
            {
                throw new SpriteException("Tile " + key + " does not exist");
            }

            // Create an SVG drawable
            IDrawable rsvg = new RsvgDrawable(tile.File);

            // Wrap this drawable (which handles some caching) into a
            // tile drawable which understands the tileset
            IDrawable drawable = new TileDrawable(tile, rsvg);

            // Return the drawable
            return(drawable);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Constructs a drawable object using the given key.
        /// </summary>
        public IDrawable Create(string key)
        {
            // Get the tile
            Tile tile = null;

            try
            {
                tile = tiles[key];
            }
            catch
            {
                throw new SpriteException("Tile " + key + " does not exist");
            }

            // Create an SVG drawable
            IDrawable rsvg = new RsvgDrawable(tile.File);

            // Wrap this drawable (which handles some caching) into a
            // tile drawable which understands the tileset
            IDrawable drawable = new TileDrawable(tile, rsvg);

            // Return the drawable
            return drawable;
        }