예제 #1
0
 public void LoadMap(string texturePath, Vector2 tileSize)
 {
     if (File.Exists(texturePath))
     {
         try
         {
             map = new TileMap(tileSize);
             map.SpriteSheet = base.LoadTexture(texturePath, System.IO.Path.GetFileNameWithoutExtension(texturePath));
         }
         catch
         {
             MessageBox.Show("Error Loading " + Path.GetFileName(texturePath), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     else
     {
         MessageBox.Show("File Path Does not exist", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
예제 #2
0
 /// <summary>
 /// Loads the map viewer and sprite sheet, setting up the map with the given value
 /// </summary>
 /// <param name="spriteSheet">The sprite sheet to use to edit the map</param>
 /// <param name="map">The map to create things from</param>
 /// <param name="tileSize">The size of the tiles on the map</param>
 public void LoadViewers(string spriteSheet, TileMap map, Vector2 tileSize)
 {
     LoadViewers(spriteSheet, tileSize);
     this.ucMapEdit.Map = map;
 }
예제 #3
0
 public MapObject(string name, TileMap tileMap)
 {
     this.id = -1;
     this.name = name;
     this.tileMap = tileMap;
 }
예제 #4
0
 /// <summary>
 /// Creates the map using the given texture and tile size
 /// </summary>
 /// <param name="texture">The texture to load into the map</param>
 /// <param name="cameraSize">The size of the camera</param>
 public void LoadMap(Texture2D texture, Vector2 tileSize)
 {
     if (texture != null && tileSize != null)
     {
         map = new TileMap(tileSize);
         map.SpriteSheet = texture;
     }
     else
     {
         MessageBox.Show("Error Loading texture", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }