aboutsummaryrefslogtreecommitdiff
path: root/SuperPolarityMac/LetterChooseWidget.cs
diff options
context:
space:
mode:
authorBen Beltran <ben@nsovocal.com>2014-02-11 01:15:19 -0600
committerBen Beltran <ben@nsovocal.com>2014-02-11 01:15:19 -0600
commitd7a43ae2d3d4702bd199fa5d8ca84c7c6e78ed36 (patch)
tree28be1c08e360ad3122042243a326f1352797d802 /SuperPolarityMac/LetterChooseWidget.cs
parent6fceaa7b34f4d6efc497cda51679b37e530a61aa (diff)
Consolidate with mac project.
Diffstat (limited to 'SuperPolarityMac/LetterChooseWidget.cs')
-rw-r--r--SuperPolarityMac/LetterChooseWidget.cs84
1 files changed, 0 insertions, 84 deletions
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<SpriteFont>("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);
- }
- }
-}