コード例 #1
0
 public TextureMap(TextureMap map)
 {
     TileTexture  = map.TileTexture;
     TextureWidth = map.TextureHeight;
     TileWidth    = map.TileWidth;
     TileHeight   = map.TileHeight;
 }
コード例 #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();
                }
            }
        }
コード例 #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);
 }
コード例 #4
0
 public Rectangle GetTileOnSheet(int id)
 {
     return(TextureMap.GetTileOnSheet(id));
 }