2 using System.Collections.Generic;
5 using Microsoft.Xna.Framework;
6 using Microsoft.Xna.Framework.Graphics;
8 namespace SuperPolarity
10 class LetterChooseWidget : Widget
19 public LetterChooseWidget(SuperPolarity game, Vector2 position) : base(game, position)
23 Font = game.Content.Load<SpriteFont>("Fonts\\bigfont");
27 InputController.Bind("moveY", HandleMovement);
30 public void HandleMovement(float value)
32 if (!Active) { return; }
34 if (value > 0.8 && !Locked) {
35 CurrentChar = CurrentChar + 1;
45 if (value < -0.8 && !Locked) {
46 CurrentChar = CurrentChar - 1;
57 public override void Update(GameTime gameTime)
59 base.Update(gameTime);
61 CurrentTime = CurrentTime + gameTime.ElapsedGameTime.Milliseconds;
62 if (CurrentTime > LockRate)
71 return char.ConvertFromUtf32(CurrentChar);
74 public override void Draw(SpriteBatch spriteBatch)
76 var color = new Color(0, 0, 0, 128);
79 color = new Color(201, 0, 68, 255);
81 spriteBatch.DrawString(Font, Value(), Position, color);