X-Git-Url: https://git.r.bdr.sh/rbdr/super-polarity/blobdiff_plain/6fceaa7b34f4d6efc497cda51679b37e530a61aa..d7a43ae2d3d4702bd199fa5d8ca84c7c6e78ed36:/SuperPolarityMac/LetterChooseWidget.cs diff --git a/SuperPolarityMac/LetterChooseWidget.cs b/SuperPolarityMac/LetterChooseWidget.cs deleted file mode 100644 index e52733f..0000000 --- a/SuperPolarityMac/LetterChooseWidget.cs +++ /dev/null @@ -1,84 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; - -namespace SuperPolarity -{ - class LetterChooseWidget : Widget - { - int CurrentChar; - bool Locked; - int LockRate; - int CurrentTime; - - SpriteFont Font; - - public LetterChooseWidget(SuperPolarity game, Vector2 position) : base(game, position) - { - Active = false; - CurrentChar = 65; - Font = game.Content.Load("Fonts\\bigfont"); - LockRate = 300; - CurrentTime = 0; - - InputController.Bind("moveY", HandleMovement); - } - - public void HandleMovement(float value) - { - if (!Active) { return; } - - if (value > 0.8 && !Locked) { - CurrentChar = CurrentChar + 1; - - if (CurrentChar > 90) - { - CurrentChar = 32; - } - - Locked = true; - } - - if (value < -0.8 && !Locked) { - CurrentChar = CurrentChar - 1; - - if (CurrentChar < 32) - { - CurrentChar = 90; - } - - Locked = true; - } - } - - public override void Update(GameTime gameTime) - { - base.Update(gameTime); - - CurrentTime = CurrentTime + gameTime.ElapsedGameTime.Milliseconds; - if (CurrentTime > LockRate) - { - CurrentTime = 0; - Locked = false; - } - } - - public string Value() - { - return char.ConvertFromUtf32(CurrentChar); - } - - public override void Draw(SpriteBatch spriteBatch) - { - var color = new Color(0, 0, 0, 128); - if (Active) - { - color = new Color(201, 0, 68, 255); - } - spriteBatch.DrawString(Font, Value(), Position, color); - } - } -}