示例#1
0
        internal static void Draw(SpriteBatchHolder spriteBatches)
        {
            if (enabled && visible)
            {
                //Draw the background and textbox
                spriteBatches[DrawModes.Gui].Draw(Assets.DummyTexture, backRect, null, Color.Black * 0.6f, 0, Vector2.Zero, SpriteEffects.None, float.Epsilon);
                inputBox.Draw(spriteBatches);

                //Draw the log
                for (int i = log.Count - 1; i >= 0; i--)
                {
                    //Calculate the text position
                    Vector2 linePos = new Vector2(5, inputBox.ClickRectangle.Top - inputBox.Font.LineSpacing * (log.Count - i));

                    //Check if the text position is above the screen
                    if (linePos.Y < 0)
                    {
                        break;
                    }

                    //Draw the text
                    spriteBatches[DrawModes.Gui].DrawString(inputBox.Font, log[i].Item1, linePos, log[i].Item2, 0, Vector2.Zero, 1, SpriteEffects.None, 0);
                }
            }
        }
 public virtual void Draw(SpriteBatchHolder spriteBatches)
 {
     //Draw each gameobject and its children
     foreach (GameObject g in this)
     {
         DrawGameObject(g, spriteBatches);
     }
 }
 internal static void Draw(SpriteBatchHolder s)
 {
     //Draw the current achievement
     if (current != null)
     {
         current.Draw(s);
     }
 }
 public virtual void Draw(SpriteBatchHolder spriteBatches)
 {
     //Draw each child
     foreach (GameObject g in this)
     {
         g.Draw(spriteBatches);
     }
 }
示例#5
0
        public override void Draw(SpriteBatchHolder spriteBatches)
        {
            //Draw the bar and button
            spriteBatches[DrawModes.Gui].Draw(sliderBar, backRect, null, barColor, 0, Vector2.Zero, SpriteEffects.None, MathHelper.Clamp(Depth + float.Epsilon, 0, 1));
            spriteBatches[DrawModes.Gui].Draw(button, clickRect, null, buttonColor, 0, Vector2.Zero, SpriteEffects.None, Depth);

            base.Draw(spriteBatches);
        }
示例#6
0
        public override void Draw(SpriteBatchHolder spriteBatches)
        {
            //Draw the background
            spriteBatches[DrawModes.Gui].Draw(backTex, ClickRectangle, null, backColor, 0, Vector2.Zero, SpriteEffects.None, MathHelper.Clamp(Depth + float.Epsilon, 0, 1));
            //Draw the text
            spriteBatches[DrawModes.Gui].DrawString(font, text, textPos, textColor, 0, Vector2.Zero, 1, SpriteEffects.None, Depth);

            base.Draw(spriteBatches);
        }
 public void Draw(SpriteBatchHolder s)
 {
     //Draw the back rectangle and icon
     s[DrawModes.AlphaBlend].Draw(Assets.DummyTexture, backRect, null, backColor, 0, Vector2.Zero, SpriteEffects.None, float.Epsilon);
     s[DrawModes.AlphaBlend].Draw(icon, imageRect, null, Color.White, 0, Vector2.Zero, SpriteEffects.None, 0);
     //Draw the title and text
     s[DrawModes.AlphaBlend].DrawString(titleFont, title, new Vector2(imageRect.Right + 10, imageRect.Top), titleColor, 0, Vector2.Zero, 1, SpriteEffects.None, 0);
     s[DrawModes.AlphaBlend].DrawString(descFont, desc, new Vector2(imageRect.Right + 10, imageRect.Top + titleFont.LineSpacing), descColor, 0, Vector2.Zero, 1, SpriteEffects.None, 0);
 }
        public override void Draw(SpriteBatchHolder spriteBatches)
        {
            //Draw each particle
            foreach (Particle p in particles)
            {
                p.Draw(spriteBatches[drawMode]);
            }

            base.Draw(spriteBatches);
        }
示例#9
0
        public override void Draw(SpriteBatchHolder spriteBatches)
        {
            //Draw the text cursor
            if (showCursor && cursorVisible)
            {
                spriteBatches[DrawModes.Gui].DrawString(Font, "|", cursorPos, TextColor, 0, Vector2.Zero, 1, SpriteEffects.None, Depth);
            }

            base.Draw(spriteBatches);
        }
示例#10
0
        public override void Draw(SpriteBatchHolder spriteBatches)
        {
            //Draw each GameObject in the grid
            for (int x = 0; x < grid.GetLength(0); x++)
            {
                for (int y = 0; y < grid.GetLength(1); y++)
                {
                    if (grid[x, y] != null)
                    {
                        grid[x, y].Draw(spriteBatches, new Point(x * CellWidth, y * CellHeight));
                    }
                }
            }

            base.Draw(spriteBatches);
        }
        private void DrawGameObject(GameObject g, SpriteBatchHolder spriteBatches)
        {
            //Draw the game object
            g.Draw(spriteBatches);

            //Draw the IXDrawable
            if (g is IXDrawable)
            {
                IXDrawable gd = (IXDrawable)g;
                if (gd.Sprite != null)
                {
                    spriteBatches[gd.DrawMode].Draw(gd.Sprite, gd.Position, gd.SourceRectangle, gd.DrawColor, gd.Rotation, gd.Origin, gd.Scale, gd.Effects, gd.Depth);
                }
            }

            //Draw each child
            foreach (GameObject child in g)
            {
                DrawGameObject(child, spriteBatches);
            }
        }
 public virtual void Draw(SpriteBatchHolder spriteBatches, Point gridPosition)
 {
     Position = gridPosition.ToVector2();
     spriteBatches[DrawMode].Draw(this);
 }