protected void Initialize(Rect bounds, MenuDigits digits, int min, int max, int defaultDigit) { Bounds = bounds; Digits = digits; Min = min; Max = max; CurrentChoice = defaultDigit; DigitLines = new MenuDivider[digits.MinDigits]; for (int ii = 0; ii < DigitLines.Length; ii++) { DigitLines[ii] = new MenuDivider(Digits.GetDigitLoc(ii) + new Loc(-1, 12), MenuDigits.DIGIT_SPACE - 1); } }
public override void Draw(SpriteBatch spriteBatch) { if (!Visible) { return; } base.Draw(spriteBatch); //draw cursor if (((GraphicsManager.TotalFrameTick - PrevTick) / (ulong)FrameTick.FrameToTick(CURSOR_FLASH_TIME / 2)) % 2 == 0 || Inactive) { Loc pos = Digits.GetDigitLoc(CurrentChoice) + new Loc(-2, 2); GraphicsManager.Cursor.DrawTile(spriteBatch, new Vector2(pos.X, pos.Y - DIGIT_SEP), 1, 0, Color.White, SpriteEffects.FlipVertically); GraphicsManager.Cursor.DrawTile(spriteBatch, new Vector2(pos.X, pos.Y + DIGIT_SEP), 1, 0); } }