Exemplo n.º 1
0
 public TextureMap(TextureMap map)
 {
     TileTexture  = map.TileTexture;
     TextureWidth = map.TextureHeight;
     TileWidth    = map.TileWidth;
     TileHeight   = map.TileHeight;
 }
Exemplo n.º 2
0
        private void SwitchTextures()
        {
            Map2.TextureMap previousTexture = new Map2.TextureMap(CurrentMap.TextureMap);
            string          input           = Microsoft.VisualBasic.Interaction.InputBox("Enter Texture.", "Change TileMap");

            if (input != null && input != "")
            {
                // CurrentMap.TextureMap.TileTexture = input;
                CurrentMap.TextureMap.SetTileTexture(input, 0, 0);
                try
                {
                    OpenTextures();
                }
                catch (Exception ex)
                {
                    Forms.MessageBox.Show("Could not open texture: " + ex.Message);

                    CurrentMap.TextureMap = previousTexture;
                    OpenTextures();
                }
            }
        }
Exemplo n.º 3
0
 public Map(ContentManager content, string tileSet, int tileWidth, int tileHeight, int width, int height, int spriteWidthHeight) : this(content, width, height, spriteWidthHeight)
 {
     TextureMap = new TextureMap(tileSet, tileWidth, tileHeight, spriteWidthHeight, spriteWidthHeight);
 }
Exemplo n.º 4
0
 public Rectangle GetTileOnSheet(int id)
 {
     return(TextureMap.GetTileOnSheet(id));
 }