Пример #1
0
        public override void Draw(GraphicsDevice graphicsDevice, SpriteBatch spriteBatch)
        {
            base.Draw(graphicsDevice, spriteBatch);
            var       texture  = new SolidColorTexture(graphicsDevice, innerColor);
            var       hTexture = new SolidColorTexture(graphicsDevice, hColor);
            Rectangle inner    = new Rectangle(bound.X + borderSize, bound.Y + borderSize, bound.Width - 2 * borderSize, bound.Height - 2 * borderSize);

            spriteBatch.Draw(texture, inner, Color.White);
            if (bound.Contains(m.MousePosition))
            {
                spriteBatch.Draw(hTexture, inner, Color.White);
            }
        }
Пример #2
0
        public void DrawStatic(GraphicsDevice graphicsDevice, SpriteBatch spriteBatch)
        {
            var headBarTexture = new SolidColorTexture(graphicsDevice, Color.DarkGray);
            var bodyTexture    = new SolidColorTexture(graphicsDevice, Color.DimGray);

            spriteBatch.Begin();
            spriteBatch.Draw(headBarTexture, new Rectangle((int)pos.X, (int)pos.Y, (int)size.X, windowBarHeight), Color.White);
            minimizeButton.Draw(graphicsDevice, spriteBatch);
            if (!minimized)
            {
                spriteBatch.Draw(bodyTexture, new Rectangle((int)pos.X, (int)pos.Y + windowBarHeight, (int)size.X, (int)size.Y - windowBarHeight), Color.White);
                //Draw all UI Elements
                foreach (var element in uiElements)
                {
                    element.Draw(graphicsDevice, spriteBatch);
                }
            }
            spriteBatch.End();
        }
Пример #3
0
        public virtual void Draw(GraphicsDevice graphicsDevice, SpriteBatch spriteBatch)
        {
            var texture = new SolidColorTexture(graphicsDevice, color);

            spriteBatch.Draw(texture, bound, Color.White);
        }