/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); //TODO: Make this more streamlined, and less manual TexturePool.AddTexture("menuscreen", Content.Load <Texture2D>("mainmenu")); TexturePool.AddTexture("button", Content.Load <Texture2D>("button")); TexturePool.AddTexture("dialogue", Content.Load <Texture2D>("DialogueBox")); TexturePool.AddTexture("select", Content.Load <Texture2D>("Selector")); TexturePool.AddTexture("itemSlot", Content.Load <Texture2D>("New Wall")); TexturePool.AddTexture("testItem", Content.Load <Texture2D>("Enemy")); //TexturePool.AddTexture("testItem", Content.Load<Texture2D>("Water")); TexturePool.AddFont("dialogue_font", Content.Load <SpriteFont>("Main Font")); TexturePool.AddTexture("robot_l", Content.Load <Texture2D>("robot_l")); TexturePool.AddTexture("robot_r", Content.Load <Texture2D>("robot_r")); TexturePool.AddTexture("robot_u", Content.Load <Texture2D>("robot_u")); TexturePool.AddTexture("robot_d", Content.Load <Texture2D>("robot_d")); //ReadTileSheets(); TexturePool.AddTileSheet("World Tiles", new TileSheet(GraphicsDevice, Content.Load <Texture2D>("World Tiles"), 32, 32)); TexturePool.AddTileSheet("Objects", new TileSheet(GraphicsDevice, Content.Load <Texture2D>("Objects"), 32, 32)); gGameMode.Push("gamestate"); gGameMode.Push("mainmenu"); // TODO: use this.Content to load your game content here }
public void ReadTileSheets() { string[] sheets = Directory.GetFiles("../../../../tilesheets/", "*.png"); List <string> sheetss = new List <string>(); foreach (string s in sheets) { sheetss.Add(s.TrimEnd('.', 'p', 'n', 'g')); } foreach (string s in sheets) { TexturePool.AddTileSheet(Path.GetFileName(s), new TileSheet(GraphicsDevice, Content.Load <Texture2D>(Path.GetFileName(s)), 32, 32)); } }