sneak/Shared/Textures.cs
Colin McMillen f8fa66385d Display "Paused" message when paused.
Add a new "Banner" style font for the pause message.

GitOrigin-RevId: 62f9537574351b961d7a2bd74f12e218f1047062
2020-02-26 17:44:36 -05:00

64 lines
2.3 KiB
C#

using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using System.Collections.Generic;
namespace SemiColinGames {
class TextureRef {
private static readonly List<TextureRef> allTextures = new List<TextureRef>();
public static void LoadAll(ContentManager content) {
foreach (TextureRef texture in allTextures) {
texture.Load(content);
}
}
private readonly string contentPath;
public TextureRef(string contentPath) {
allTextures.Add(this);
this.contentPath = contentPath;
}
public Texture2D Get { get; private set; }
private void Load(ContentManager content) {
Get = content.Load<Texture2D>(contentPath);
}
}
class Textures {
public static SpriteFont DebugFont;
public static SpriteFont BannerFont;
public static TextureRef Player = new TextureRef("sprites/ccg/ninja_female");
// Backgrounds are indexed by draw order; the first element should be drawn furthest back.
public static TextureRef[] Backgrounds = new TextureRef[] {
new TextureRef("backgrounds/szadiart/pf4/background1_day"),
new TextureRef("backgrounds/szadiart/pf4/background2a_day"),
new TextureRef("backgrounds/szadiart/pf4/background3_day"),
new TextureRef("backgrounds/szadiart/pf4/background4_day"),
};
public static TextureRef Cemetery = new TextureRef("tiles/anokolisa/cemetery");
public static TextureRef Crypt = new TextureRef("tiles/anokolisa/crypt");
public static TextureRef Dungeon = new TextureRef("tiles/anokolisa/dungeon");
public static TextureRef Forest = new TextureRef("tiles/anokolisa/forest");
public static TextureRef Garden = new TextureRef("tiles/anokolisa/garden");
public static TextureRef Grassland = new TextureRef("tiles/anokolisa/grassland");
public static TextureRef Ruins = new TextureRef("tiles/anokolisa/ruins");
public static TextureRef Sewer = new TextureRef("tiles/anokolisa/sewer");
public static TextureRef Temple = new TextureRef("tiles/anokolisa/temple");
public static TextureRef Village = new TextureRef("tiles/anokolisa/village");
public static void Load(ContentManager content) {
DebugFont = content.Load<SpriteFont>("fonts/debug");
BannerFont = content.Load<SpriteFont>("fonts/banner");
TextureRef.LoadAll(content);
}
}
}