public void LoadContent() { var fontTexture = ContentManager.GetTexture2D(_graphicsDevice, "Content\\Font\\Font.png"); var mapping = ContentManager.GetFontMapping("Content\\Font\\FontMapping.txt"); var framedSprite = new CelledSprite(8, 6, fontTexture, Vector2.Zero); _font = new Font(framedSprite, mapping); using (StreamReader sr = new StreamReader("Content\\Saves\\HighScores.txt", System.Text.Encoding.Default)) { var text = sr.ReadToEnd(); var lines = text.Split('\n'); var listSize = lines.Length / 2; for (int i = 0; i < listSize; ++i) { var playersScore = new PlayerScore { Name = lines[i * 2], Score = lines[i * 2 + 1] }; _playerScores.Add(playersScore); } } }
public void LoadContent() { var fontTexture = ContentManager.GetTexture2D(_graphicsDevice, "Content\\Font\\Font.png"); var mapping = ContentManager.GetFontMapping("Content\\Font\\FontMapping.txt"); var framedSprite = new CelledSprite(8, 6, fontTexture, Vector2.Zero); _font = new Font(framedSprite, mapping); }
public void LoadContent() { var _heartTexture = ContentManager.GetTexture2D(_graphicsDevice, "Content\\Textures\\Heart.png"); var playersTexture = ContentManager.GetTexture2D(_graphicsDevice, "Content\\Textures\\Hero\\Loaded.png"); _playerSprite = new PlayerSprite (playersTexture, _difficulityLevel, new Vector2(380, 470), _graphicsDevice); var fontTexture = ContentManager.GetTexture2D(_graphicsDevice, "Content\\Font\\Font.png"); var mapping = ContentManager.GetFontMapping("Content\\Font\\FontMapping.txt"); var framedSprite = new CelledSprite(8, 6, fontTexture, Vector2.Zero); _font = new Font(framedSprite, mapping); _heartSprite = new Sprite(_heartTexture, new Vector2(20, 550)); }
public Font(CelledSprite pFramedSprite, Dictionary <char, int> pMapping) { _framedSprite = pFramedSprite; _mapping = pMapping; }