public void RenderLocationText(LocationText locationText, SpriteBatch spriteBatch) { if (!locationText.Alive) { return; } var shadowCol = new Color(0, 0, 0, locationText.Colour.A); spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied, SamplerState.PointClamp, DepthStencilState.None, RasterizerState.CullCounterClockwise, null, spriteScale); spriteBatch.DrawString(Fonts.Aaargh, locationText.Text, locationText.Offset + new Vector2(1, 0), shadowCol); spriteBatch.DrawString(Fonts.Aaargh, locationText.Text, locationText.Offset + new Vector2(-1, 0), shadowCol); spriteBatch.DrawString(Fonts.Aaargh, locationText.Text, locationText.Offset + new Vector2(0, -1), shadowCol); spriteBatch.DrawString(Fonts.Aaargh, locationText.Text, locationText.Offset + new Vector2(0, 1), shadowCol); spriteBatch.DrawString(Fonts.Aaargh, locationText.Text, locationText.Offset, locationText.Colour); spriteBatch.End(); }
private void HandleInput() { if (KeyBind.WasCommandPressed(KeyBind.Command.Start)) { menus.PushMenu(pauseMenu); locationText = new LocationText("Welcome to Nightvale"); } if (world.DialogueBox != null) { world.DialogueBox.Input(world); if (world.DialogueBox.DialogueDone) { world.DialogueBox = null; } } player.Input(); KeyBind.Refresh(); }
public MainGameState(Main game) : base(game) { menus = new MenuStack(); pauseMenu = new PauseMenu(); pauseMenu.Options.SetOptionFunc(1, ExitToMainMenu); pauseMenu.Options.SetOptionFunc(2, ExitToDesktop); Score = new ScoreManager(); currentLevel = 1; world = new World(new TileSpriteSheet(Images.GetImage("beach_tileset"))); player = world.LoadLevel("../../../../Data/the_level"); world.LoadLevel("../../../../Data/caves"); camera = new Camera(player); renderer = game.Renderer; hudCoin = new Coin(world); hudCoin.Pos = new Vector2(-9999, -9999); locationText = new LocationText("Welcome to Nightvale"); }