示例#1
0
        public override void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(texPixel, new Rectangle(Point.Zero, ScreenSize), Color.Black);

            foreach (var tab in tabs)
            {
                tab.Draw(spriteBatch);
            }
            foreach (var panel in panels)
            {
                panel.Draw(spriteBatch);
            }
            btnBack.Draw(spriteBatch);

            if (maxPage > 0)
            {
                btnPrevPage.Draw(spriteBatch);
                btnNextPage.Draw(spriteBatch);

                string  text     = $"{currentPage + 1}/{maxPage + 1}";
                Vector2 textSize = font.MeasureString(text) * paginatorTextScale;

                if (ScreenSize.X > ScreenSize.Y)
                {
                    spriteBatch.DrawString(font, text, new Vector2(paginatorPosition.X + (paginatorBtnSize - textSize.X) / 2, paginatorPosition.Y + paginatorBtnSize + (paginatorBtnSize * 2 - textSize.Y) / 2), Color.White, 0, Vector2.Zero, paginatorTextScale, SpriteEffects.None, 0);
                }
                else
                {
                    spriteBatch.DrawString(font, text, new Vector2(paginatorPosition.X + paginatorBtnSize + (paginatorBtnSize * 2 - textSize.X) / 2, paginatorPosition.Y + paginatorBtnSize * 0.2f), Color.White, 0, Vector2.Zero, paginatorTextScale, SpriteEffects.None, 0);
                }
            }

            base.Draw(spriteBatch);
        }
 public override void Draw(SpriteBatch spriteBatch)
 {
     spriteBatch.Draw(backgroundTexture, Vector2.Zero, Color.White);
     btnLinkGithub.Draw(spriteBatch);
     btnLinkTheWitness.Draw(spriteBatch);
     btnBack.Draw(spriteBatch);
     base.Draw(spriteBatch);
 }
示例#3
0
        public void Draw(SpriteBatch sb)
        {
            btnDown.Draw(sb);
            btnUp.Draw(sb);

            int filledWidth = (int)(sliderSize.X * (Value / maxValue));

            sb.Draw(texPixel, new Rectangle(area.Location + sliderPadding, sliderSize), bgColor);
            sb.Draw(texPixel, new Rectangle(area.Location + sliderPadding, new Point(filledWidth, sliderSize.Y)), activeColor);
        }