Ejemplo n.º 1
0
 public void DrawPreview(SpriteBatch sb)
 {
     if (drag)
     {
         CurrentItem.Draw(sb);
     }
 }
Ejemplo n.º 2
0
        public override void Draw(GameTime gameTime)
        {
            primBatch.Begin(PrimitiveType.TriangleList);
            //white text area
            primBatch.AddVertex(new Vector2(Bounds.Left, Bounds.Bottom), BackgroundColor);
            primBatch.AddVertex(new Vector2(Bounds.Left, Bounds.Top), BackgroundColor);
            primBatch.AddVertex(new Vector2(Bounds.Right, Bounds.Top), BackgroundColor);

            primBatch.AddVertex(new Vector2(Bounds.Right, Bounds.Top), BackgroundColor);
            primBatch.AddVertex(new Vector2(Bounds.Right, Bounds.Bottom), BackgroundColor);
            primBatch.AddVertex(new Vector2(Bounds.Left, Bounds.Bottom), BackgroundColor);

            primBatch.End();

            GUIListBoxItem CurrentItem;

            if (ListOpen)
            {
                for (int i = topItem; i < topItem + numItems; i++)
                {
                    CurrentItem = (GUIListBoxItem)Items[i];
                    CurrentItem.Draw(gameTime);
                }

                foreach (GUIComponent c in components)
                {
                    c.Draw(gameTime);
                }
            }
            else
            {
                // Just draw title and open button
                currentItem.Draw(gameTime);
                OpenCloseList.Draw(gameTime);
            }
        }