Пример #1
0
 public virtual void Draw(SpriteBatch sb, Texture2D pixel)
 {
     sb.Draw(pixel, rect, bgColor);
     sb.DrawRectangleOutline(pixel, rect, Color.White, 1);
     foreach (Control item in controls)
     {
         item.Draw(sb, pixel);
     }
 }
Пример #2
0
 private void DrawHeader(SpriteBatch sb, Texture2D pixel)
 {
     int count = tabs.Count;
     int width = rect.Width;
     int tabWidth = width / count;
     area = new Rectangle(rect.X, rect.Y - 30, tabWidth, 30);
     for (int i = 0; i < count; i++)
     {
         if (selectedTab == i)
         {
             sb.Draw(pixel, area, Color.Black * 0.3f);
         }
         else
         {
             sb.Draw(pixel, area, Color.Gray * 0.5f);
         }
         sb.DrawRectangleOutline(pixel, area, Color.White, 1);
         sb.DrawString(Game1.font, tabs[i].name, new Vector2(area.X + 4, area.Y + 4), Color.White);
         area.X += tabWidth;
     }
 }