Sprite GetLetter(char c) { string name = "Char:" + c; Sprite sprite; if (!sprites.TryGetValue(name, out sprite)) { Surface surface = font.Render("" + c, System.Drawing.Color.Blue, System.Drawing.Color.Black, true); surface.TransparentColor = System.Drawing.Color.Black; sprite = new Sprite(surface); sprites.Add(name, sprite); } return sprite; }
Sprite GetSprite(string path) { Sprite result; if (!sprites.TryGetValue(path, out result)) { result = new Sprite(Path.Combine(dataDir, path)); sprites.Add(path, result); } return result; }