Example #1
0
 private void LoadTextures()
 {
     // Load the terrain atlas.
     if (TerrainAtlas == null)
     {
         var tex = Main.ContentMangager.Load <Texture2D>("Textures/Default Terrain");
         TerrainAtlas = new TextureAtlas <byte>(tex);
         byte[] ids = new byte[4];
         for (byte i = 0; i < ATLAS_WIDTH * ATLAS_HEIGHT; i++)
         {
             ids[i] = i;
         }
         TerrainAtlas.AddGridSprites(ids, ATLAS_WIDTH, ATLAS_HEIGHT, TILE_SIZE, TILE_SIZE);
     }
 }