public void Draw(SpriteBatch spriteBatch, GraphicsDeviceManager graphics) { Background.Draw(spriteBatch, graphics); // Banner string DayString = MainCharacter.GetDateTimeString(); DrawingUtils.DrawTextBanner(spriteBatch, graphics, Arial, DayString, Color.Red, Color.Black); if (GState == InterviewState.TopicChoice) { // draw placeholders for now Texture2D Phoenix = Content.Load <Texture2D>("Characters/blush"); spriteBatch.Draw(Phoenix, new Vector2(100, 300), Color.White); Texture2D Edgeworth = Content.Load <Texture2D>("Characters/tomazzi"); spriteBatch.Draw(Edgeworth, new Vector2(900, 300), Color.White); Texture2D Thought = Content.Load <Texture2D>("thought"); spriteBatch.Draw(Thought, new Rectangle(350, 300, 500, 500), Color.White); foreach (Button TopicButton in TopicButtons) { TopicButton.Draw(spriteBatch, graphics); } } if (GState == InterviewState.PlayText) { // Contradict icon is just notebook icon for now ContradictButton.Draw(spriteBatch, graphics); EventScript.Draw(spriteBatch, graphics); } }
private void Util_OnUsingKeyboardStatusChanged(object sender, Util.BoolEventArgs e) { MainCanvas.SetActive(!e.Result); if (!e.Result) { if (TopicButton == null || string.IsNullOrEmpty(Util.UserName)) { return; } TopicButton.GetComponentInChildren <Text>().text = "Welcome back, " + Util.UserName; } }
public void Update(GameEngine gameEngine, GameTime gameTime) { if (IsTransitioning) { return; } MouseState = Mouse.GetState(); if (PrevMouseState.LeftButton == ButtonState.Pressed && MouseState.LeftButton == ButtonState.Released) { MouseClicked(gameTime, MouseState.X, MouseState.Y); } switch (GState) { case InterviewState.Contradiction: gameEngine.Push(new NotebookManager(true, ref IdContradict), true, true); IsTransitioning = true; break; case InterviewState.Exiting: gameEngine.Pop(true, true); IsTransitioning = true; break; case InterviewState.TopicChoice: foreach (Button TopicButton in TopicButtons) { TopicButton.Update(); } break; case InterviewState.PlayText: ContradictButton?.Update(); EventScript.Update(gameTime); if (EventScript.IsFinished()) { GState = (!IsContradicted) ? InterviewState.TopicChoice : InterviewState.Exiting; EventScript = null; MainCharacter.TestimonyIds.Add(TestimonyId); } break; default: break; } PrevMouseState = MouseState; }