private static void drawElevator(SpriteBatch b, ClickableComponent elevator)
        {
            b.Draw(Game1.mouseCursors, new Vector2((elevator.bounds.X - 4), (elevator.bounds.Y + 4)), new Rectangle(elevator.scale > 1.0 ? 267 : 256, 256, 10, 10), Color.Black * 0.5f, 0.0f, Vector2.Zero, 4f, SpriteEffects.None, 0.865f);

            b.Draw(Game1.mouseCursors, new Vector2(elevator.bounds.X, elevator.bounds.Y), new Rectangle(elevator.scale > 1.0f ? 267 : 256, 256, 10, 10), Color.White, 0.0f, Vector2.Zero, 4f, SpriteEffects.None, 0.868f);

            int     floor   = Convert.ToInt32(elevator.name);
            Vector2 vector2 = new Vector2((elevator.bounds.X + 16 + NumberSprite.numberOfDigits(floor) * 6),
                                          (elevator.bounds.Y + 24 - NumberSprite.getHeight() / 4));

            bool skull = ((Game1.CurrentMineLevel == floor + 120) && Game1.currentLocation.Equals(Game1.mine)) ||
                         (floor == 0 && Game1.currentLocation.Name == "SkullCave");

            NumberSprite.draw(floor, b, vector2, skull? Color.Gray * 0.75f : Color.Gold, 0.5f, 0.86f, 1f, 0, 0);
        }
        public override void draw(SpriteBatch b)
        {
            base.draw(b);

            foreach (ClickableComponent current in this.elevators)
            {
                int     floor   = Convert.ToInt32(current.name);
                Vector2 vector2 = new Vector2(current.bounds.X + 16 + NumberSprite.numberOfDigits(floor) * 6,
                                              current.bounds.Y + 24 - NumberSprite.getHeight() / 4);

                bool skull = ((Game1.CurrentMineLevel == floor + 120) && Game1.currentLocation.Equals(Game1.mine)) ||
                             (floor == 0 && Game1.currentLocation.Name == "SkullCave");

                NumberSprite.draw(floor, b, vector2, skull ? Color.Gray * 0.75f : Color.Gold, 0.5f, 0.86f, 1f, 0, 0);
            }

            this.drawMouse(b);
        }
Beispiel #3
0
        public IntegerEditor(string text, int startingNumber, int minimum, int maximum, Vector2 location, ClickCallback onClickCallback, int increment = 1)
        {
            if (maximum <= minimum)
            {
                throw new ArgumentException($"{nameof(minimum)} value cannot exceed {nameof(maximum)} value.");
            }
            _onClick  = onClickCallback;
            Value     = startingNumber.Clamp(minimum, maximum);
            Minimum   = minimum;
            Maximum   = maximum;
            Text      = text;
            Increment = increment;
            int buttonYOffset = Game1.smallFont.MeasureString(text).Y.Ceiling() + _linePadding;

            _minusButton = new TextureButton(new Rectangle(location.X.Floor(), location.Y.Floor() + buttonYOffset, PixelsWide * Game1.pixelZoom, PixelsHigh * Game1.pixelZoom), Game1.mouseCursors, OptionsPlusMinus.minusButtonSource, MinusButtonClicked);
            int plusButtonOffset = MeasureNumberWidth(Maximum) + _minusButton.Bounds.Width;

            _plusButton = new TextureButton(new Rectangle(location.X.Floor() + plusButtonOffset, location.Y.Floor() + buttonYOffset, PixelsWide * Game1.pixelZoom, PixelsHigh * Game1.pixelZoom), Game1.mouseCursors, OptionsPlusMinus.plusButtonSource, PlusButtonClicked);
            int maxWidth = new[] { _plusButton.Bounds.X + _plusButton.Bounds.Width - location.X.Floor(), Game1.smallFont.MeasureString(text).X.Ceiling() }.Max();
            int maxHeight = buttonYOffset + new[] { _minusButton.Bounds.Height, _plusButton.Bounds.Height, NumberSprite.getHeight() }.Max();

            Bounds = new Rectangle(location.X.Floor(), location.Y.Floor(), maxWidth, maxHeight);
        }
 public override void draw(SpriteBatch b)
 {
     base.draw(b);
     Game1.drawDialogueBox(calculatorX, calculatorY, calculatorWidth, calculatorHeight, speaker: false, drawOnlyBox: true);
     foreach (ClickableComponent c in digits)
     {
         if (c.name == clear)
         {
             b.Draw(Game1.mouseCursors, new Vector2(c.bounds.X - 4, c.bounds.Y + 4), new Rectangle((c.scale > 1f) ? 267 : 256, 256, 10, 10), Color.Black * 0.5f, 0f, Vector2.Zero, 4f, SpriteEffects.None, 0.865f);
             b.Draw(Game1.mouseCursors, new Vector2(c.bounds.X, c.bounds.Y), new Rectangle((c.scale > 1f) ? 267 : 256, 256, 10, 10), Color.White * 0.6f, 0f, Vector2.Zero, 4f, SpriteEffects.None, 0.868f);
             Vector2 textPosition = new Vector2(c.bounds.X + c.bounds.Width / 2 - SpriteText.getWidthOfString(c.name) / 2, c.bounds.Y + c.bounds.Height / 2 - SpriteText.getHeightOfString(c.name) / 2 - 4);
             SpriteText.drawString(b, c.name, (int)textPosition.X, (int)textPosition.Y);
         }
         else
         {
             b.Draw(Game1.mouseCursors, new Vector2(c.bounds.X - 4, c.bounds.Y + 4), new Rectangle((c.scale > 1f) ? 267 : 256, 256, 10, 10), Color.Black * 0.5f, 0f, Vector2.Zero, 4f, SpriteEffects.None, 0.865f);
             b.Draw(Game1.mouseCursors, new Vector2(c.bounds.X, c.bounds.Y), new Rectangle((c.scale > 1f) ? 267 : 256, 256, 10, 10), Color.White, 0f, Vector2.Zero, 4f, SpriteEffects.None, 0.868f);
             NumberSprite.draw(position: new Vector2(c.bounds.X + 16 + NumberSprite.numberOfDigits(Convert.ToInt32(c.name)) * 6, c.bounds.Y + 24 - NumberSprite.getHeight() / 4), number: Convert.ToInt32(c.name), b: b, c: Color.Gold, scale: 0.5f, layerDepth: 0.86f, alpha: 1f, secondDigitOffset: 0);
         }
     }
     drawMouse(b);
 }
Beispiel #5
0
        public override void draw(SpriteBatch b)
        {
            Game1.spriteBatch.Draw(Game1.fadeToBlackRect, Game1.graphics.GraphicsDevice.Viewport.Bounds, Color.Black);

            b.Draw(Game1.fadeToBlackRect, Game1.graphics.GraphicsDevice.Viewport.Bounds, Color.Black * 0.4f);
            Game1.drawDialogueBox(this.xPositionOnScreen, this.yPositionOnScreen - 64 + 8, this.width + 21, this.height + 64, false, true, (string)null, false);
            foreach (ClickableComponent levelButton in this.levelButtons)
            {
                b.Draw(Game1.mouseCursors, new Vector2((float)(levelButton.bounds.X - 4), (float)(levelButton.bounds.Y + 4)), new Rectangle?(new Rectangle((double)levelButton.scale > 1.0 ? 267 : 256, 256, 10, 10)), Color.Black * 0.5f, 0.0f, Vector2.Zero, 4f, SpriteEffects.None, 0.865f);
                b.Draw(Game1.mouseCursors, new Vector2((float)levelButton.bounds.X, (float)levelButton.bounds.Y), new Rectangle?(new Rectangle((double)levelButton.scale > 1.0 ? 267 : 256, 256, 10, 10)), Color.White, 0.0f, Vector2.Zero, 4f, SpriteEffects.None, 0.868f);
                Vector2 position = new Vector2((float)(levelButton.bounds.X + 16 + NumberSprite.numberOfDigits(Convert.ToInt32(levelButton.name)) * 6), (float)(levelButton.bounds.Y + 24 - NumberSprite.getHeight() / 4));
                NumberSprite.draw(Convert.ToInt32(levelButton.name), b, position, Game1.CurrentMineLevel == Convert.ToInt32(levelButton.name) ? Color.Gray * 0.75f : Color.Gold, 0.5f, 0.86f, 1f, 0, 0);
            }
            this.drawMouse(b);
            base.draw(b);
        }
 // Token: 0x06000F4B RID: 3915 RVA: 0x0013AFFC File Offset: 0x001391FC
 public override void draw(SpriteBatch b)
 {
     b.Draw(Game1.fadeToBlackRect, Game1.graphics.GraphicsDevice.Viewport.Bounds, Color.Black * 0.4f);
     Game1.drawDialogueBox(this.xPositionOnScreen, this.yPositionOnScreen - Game1.tileSize + Game1.tileSize / 8, this.width + Game1.tileSize / 3, this.height + Game1.tileSize, false, true, null, false);
     foreach (ClickableComponent c in this.elevators)
     {
         b.Draw(Game1.mouseCursors, new Vector2((float)(c.bounds.X - Game1.pixelZoom), (float)(c.bounds.Y + Game1.pixelZoom)), new Rectangle?(new Rectangle((c.scale > 1f) ? 267 : 256, 256, 10, 10)), Color.Black * 0.5f, 0f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, 0.865f);
         b.Draw(Game1.mouseCursors, new Vector2((float)c.bounds.X, (float)c.bounds.Y), new Rectangle?(new Rectangle((c.scale > 1f) ? 267 : 256, 256, 10, 10)), Color.White, 0f, Vector2.Zero, (float)Game1.pixelZoom, SpriteEffects.None, 0.868f);
         Vector2 textPosition = new Vector2((float)(c.bounds.X + 16 + NumberSprite.numberOfDigits(Convert.ToInt32(c.name)) * 6), (float)(c.bounds.Y + Game1.pixelZoom * 6 - NumberSprite.getHeight() / 4));
         NumberSprite.draw(Convert.ToInt32(c.name), b, textPosition, ((Game1.mine.mineLevel == Convert.ToInt32(c.name) && Game1.currentLocation.Equals(Game1.mine)) || (Convert.ToInt32(c.name) == 0 && !Game1.currentLocation.Equals(Game1.mine))) ? (Color.Gray * 0.75f) : Color.Gold, 0.5f, 0.86f, 1f, 0, 0);
     }
     base.drawMouse(b);
     base.draw(b);
 }
 public override void draw(SpriteBatch b)
 {
     b.Draw(Game1.fadeToBlackRect, Game1.graphics.GraphicsDevice.Viewport.Bounds, Color.Black * 0.4f);
     Game1.drawDialogueBox(xPositionOnScreen, yPositionOnScreen - 64 + 8, width + 21, height + 64, speaker: false, drawOnlyBox: true);
     foreach (ClickableComponent c in elevators)
     {
         b.Draw(Game1.mouseCursors, new Vector2(c.bounds.X - 4, c.bounds.Y + 4), new Rectangle((c.scale > 1f) ? 267 : 256, 256, 10, 10), Color.Black * 0.5f, 0f, Vector2.Zero, 4f, SpriteEffects.None, 0.865f);
         b.Draw(Game1.mouseCursors, new Vector2(c.bounds.X, c.bounds.Y), new Rectangle((c.scale > 1f) ? 267 : 256, 256, 10, 10), Color.White, 0f, Vector2.Zero, 4f, SpriteEffects.None, 0.868f);
         NumberSprite.draw(position: new Vector2(c.bounds.X + 16 + NumberSprite.numberOfDigits(Convert.ToInt32(c.name)) * 6, c.bounds.Y + 24 - NumberSprite.getHeight() / 4), number: Convert.ToInt32(c.name), b: b, c: (Game1.CurrentMineLevel == Convert.ToInt32(c.name)) ? (Color.Gray * 0.75f) : Color.Gold, scale: 0.5f, layerDepth: 0.86f, alpha: 1f, secondDigitOffset: 0);
     }
     drawMouse(b);
     base.draw(b);
 }