Exemplo n.º 1
0
 public void Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch)
 {
     spriteBatch.End();
     spriteBatch.Begin();
     foreach (Star s in _Stars)
     {
         spriteBatch.Draw(_CloudTexture, s.Position, null, s.Color, 0, Vector2.Zero, s.Scale, SpriteEffects.None, 0);
     }
     spriteBatch.End();
     spriteBatch.Begin();
 }
Exemplo n.º 2
0
        protected override void DrawSprite(Microsoft.Xna.Framework.Graphics.SpriteBatch batch)
        {
            batch.End();

            batch.Begin(SpriteSortMode.Immediate,
                        null, SamplerState.LinearWrap, null, null);
            batch.Draw(texture, Vector2.Zero,
                       new Rectangle(0, (int) Position.Y, Width, Height), Color.White);
            batch.End();
            batch.Begin();
        }
Exemplo n.º 3
0
        public override void DrawWorld(Microsoft.Xna.Framework.Graphics.SpriteBatch batch)
        {
            batch.Begin();
            nBuild.DrawLaser(batch, Screen.RelationToPosition(owner.Position), Screen.RelationToPosition(new Vector2(-Screen.X, owner.Position.Y)), lastHit, 0.05f * Screen.Height);

            batch.End();
        }
        public override void Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, PrimitiveDrawer primitiveDrawer, FontHandler fontHandler, Microsoft.Xna.Framework.Graphics.GraphicsDevice graphicsDevice)
        {
            String text = mode ? "True" : "False";
            Color color = !GetSelected() ? colorA : colorB;

            Rectangle numRect = this.ToRectangle();
            numRect.Width = boolWidth;

            Rectangle rect = this.ToRectangle();

            this.width = (rect.Width = (int)fontHandler.GetVerdana().MeasureString(" " + text + " ").X + 3) + boolWidth;

            rect.X += boolWidth;
            primitiveDrawer.DrawRoundedRectangle(graphicsDevice, rect, color);
            primitiveDrawer.DrawRoundedRectangle(graphicsDevice, numRect, new Color(0x3D, 0x70, 0xBC));
            Vector2 vector = this.GetVector();

            vector.X += 3;
            vector.Y += 3;

            spriteBatch.DrawString(fontHandler.GetVerdana(), " Bool ", vector + TetrisGameRunner.GetOffsetVector(), Color.White);

            vector.X += boolWidth - 3;

            spriteBatch.DrawString(fontHandler.GetVerdana(), " " + text + " ", vector + TetrisGameRunner.GetOffsetVector(), Color.White);
            spriteBatch.End();
            spriteBatch.Begin();
        }
Exemplo n.º 5
0
        public override void Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, PrimitiveDrawer primitiveDrawer, FontHandler fontHandler, Microsoft.Xna.Framework.Graphics.GraphicsDevice graphicsDevice)
        {
            Rectangle numRect = this.ToRectangle();
            numRect.Width = strWidth;

            Rectangle rect = this.ToRectangle();
            this.width = (rect.Width = (int)fontHandler.GetVerdana().MeasureString(" " + formatText(fontHandler) + " ").X + 3) + strWidth;
            rect.X += strWidth;

            if (this.text.Length > 0 || GetSelected())
                if (selected)
                {
                    primitiveDrawer.DrawRoundedRectangle(graphicsDevice, rect, colorB);
                }
                else
                {
                    primitiveDrawer.DrawRoundedRectangle(graphicsDevice, rect, colorA);
                }

            primitiveDrawer.DrawRoundedRectangle(graphicsDevice, numRect, storedColor);

            Vector2 vector = this.GetVector();

            vector.X += 3;

            vector.Y += 3;

            spriteBatch.DrawString(fontHandler.GetVerdana(), " Code ", vector + TetrisGameRunner.GetOffsetVector(), Color.White);

            vector.X += strWidth;

            spriteBatch.DrawString(fontHandler.GetVerdana(), " " + formatText(fontHandler) + " ", vector + TetrisGameRunner.GetOffsetVector(), Color.White);
            spriteBatch.End();
            spriteBatch.Begin();
        }
Exemplo n.º 6
0
        public override void Draw(Microsoft.Xna.Framework.GameTime time, Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch)
        {
            UIManager.Draw(time, spriteBatch);
            ActiveMap.WorldObjects.ForEach(
                obj => ((WorldCore.IDrawable)obj).Draw(time, spriteBatch));

            spriteBatch.End();

            // Draw Particles
            spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Additive);
            PhysicsManager.PSystems.ForEach(ps => ps.Draw());
            spriteBatch.End();
            // End Drawing Particles

            spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend);
        }
Exemplo n.º 7
0
 public override void Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch pSpriteBatch)
 {
     pSpriteBatch.Begin();
     pSpriteBatch.DrawString(m_pFont, "LOADING", new Microsoft.Xna.Framework.Vector2(100, 100), Color.White);
     pSpriteBatch.End();
     base.Draw(pSpriteBatch);
 }
        public override void Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, PrimitiveDrawer primitiveDrawer, FontHandler fontHandler, Microsoft.Xna.Framework.Graphics.GraphicsDevice graphicsDevice)
        {
            if(varLink != null)
            {
                Vector2 vec = this.GetVector();
                this.varLink.SetVector(ref vec);
                this.SetWidth(varLink.GetWidth());
                this.SetHeight(varLink.GetHeight());

                varLink.Draw(spriteBatch, primitiveDrawer, fontHandler, graphicsDevice);
            }
            else
            {
                primitiveDrawer.DrawRoundedRectangle(graphicsDevice, this, colorA);
                Vector2 ve = fontHandler.GetVerdana().MeasureString(this.typeOfVariable);

                this.width = (int)ve.X + 3;
                this.height = 30;

                Vector2 vec = this.GetVector();
                vec.Y += 3;
                vec.X += 3;

                spriteBatch.DrawString(fontHandler.GetVerdana(), this.typeOfVariable, vec + TetrisGameRunner.GetOffsetVector(), Color.White);
                spriteBatch.End();
                spriteBatch.Begin();
            }
        }
Exemplo n.º 9
0
 public override void Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch _spritebatch)
 {
     _spritebatch.Begin();
     this.m_lp_extractor.Draw(_spritebatch);
     base.Draw(_spritebatch);
     _spritebatch.End();
 }
Exemplo n.º 10
0
 public override void Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch SB)
 {
     SB.Begin(SpriteSortMode.BackToFront, BlendState.NonPremultiplied);
     _Background.Draw(SB);
     Managers.EntityManager.Instance.Draw(SB);
     SB.End();
 }
Exemplo n.º 11
0
        public override void Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch pSpriteBatch)
        {
            pSpriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend);

            pSpriteBatch.DrawString(m_pFont, "#", new Vector2(200, 50), Color.White);
            pSpriteBatch.DrawString(m_pFont, "Name", new Vector2(250, 50), Color.White);
            pSpriteBatch.DrawString(m_pFont, "Waves", new Vector2(500, 50), Color.White);
            pSpriteBatch.DrawString(m_pFont, "Play time", new Vector2(650, 50), Color.White);
            pSpriteBatch.DrawString(m_pFont, "Score", new Vector2(800, 50), Color.White);

            for (int i = 0; i < 10; i++)
            {
                pSpriteBatch.DrawString(m_pFont, (i + 1).ToString(), new Vector2(200, 100 + (i*30)), Color.White);
                pSpriteBatch.DrawString(m_pFont, m_pManager.List[i].PlayerName, new Vector2(250, 100 + (i * 30)), Color.White);
                pSpriteBatch.DrawString(m_pFont, m_pManager.List[i].Wave.ToString(), new Vector2(500, 100 + (i * 30)), Color.White);
                pSpriteBatch.DrawString(m_pFont, m_pManager.List[i].PlayTime.ToString()+" sec", new Vector2(650, 100 + (i * 30)), Color.White);
                pSpriteBatch.DrawString(m_pFont, m_pManager.List[i].Score.ToString(), new Vector2(800, 100 + (i * 30)), Color.White);

            }

            pSpriteBatch.Draw(Constants.BUTTON_B, new Vector2(1100, 600), Color.White);
            pSpriteBatch.DrawString(m_pFont, "Back", new Vector2(1050, 600), Color.White);

            pSpriteBatch.End();

            base.Draw(pSpriteBatch);
        }
        public override void draw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, Microsoft.Xna.Framework.Graphics.GraphicsDevice graphicsDevice)
        {
            spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, null, null, null, null, publicStatics.spriteScale);
            //Background
            spriteBatch.Draw(Image.pauseMenu, new Rectangle(0, 0, publicStatics.screenSize.Width, publicStatics.screenSize.Height), Color.White);

            //Draw all labels
            for(int i = 0; i < labels.Count; i++)
            {
                labels[i].Draw(spriteBatch);
            }

            //Draw Bullet Points
            if (buttons[0].mouseHover())
                spriteBatch.Draw(imageRBC, new Rectangle(publicStatics.screenSize.Center.X - (int)(Font.cooper48.MeasureString("Resume").X / 2) - 52, publicStatics.screenSize.Center.Y - 36, 48, 48), Color.White);
            if (buttons[1].mouseHover())
                spriteBatch.Draw(imageRBC, new Rectangle(publicStatics.screenSize.Center.X - (int)(Font.cooper48.MeasureString("Main Menu").X / 2) - 52, publicStatics.screenSize.Center.Y - 26 + 90, 48, 48), Color.White);

            //Draw all Buttons
            for (int i = 0; i < buttons.Count; i++)
            {
                buttons[i].Draw(spriteBatch);
            }

            //Draw all Checkboxes
            for (int i = 0; i < checkboxes.Count; i++)
            {
                checkboxes[i].Draw(spriteBatch);
            }

            //Draw Mouse Cursor
            cursor.drawTexture(spriteBatch, graphicsDevice);
            spriteBatch.End();
        }
Exemplo n.º 13
0
        public override void Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch Sb, Graphics.PrimitiveRenderer Pr)
        {
            StringBuilder str = new StringBuilder();

            if (Left.Damage == Right.Damage)
                str.AppendLine("Draw!");
            else {
                str.Append("Winrar: ");
                if (Left.Damage < Right.Damage)
                    str.AppendLine("Player 1!");
                else
                    str.AppendLine("Player 2!");
            }
            str.AppendLine("Press Enter to return to track select...");
            Sb.Begin();
            Sb.DrawString(sysFont, str, resultsTextPosition, Color.White);

            str.Clear();
            str.AppendLine("Player 1\n");
            str.AppendFormat("Result score: {0}\n", Left.Score);
            str.AppendFormat("Final health: {0}\n", Left.Health);
            str.AppendFormat("Damage dealt: {0}\n", Left.Damage);
            Sb.DrawString(sysFont, str, LeftResultPosition, Color.White);

            str.Clear();
            str.AppendLine("Player 2\n");
            str.AppendFormat("Result score: {0}\n", Right.Score);
            str.AppendFormat("Final health: {0}\n", Right.Health);
            str.AppendFormat("Damage dealt: {0}\n", Right.Damage);
            Sb.DrawString(sysFont, str, RightResultPosition, Color.White);

            Sb.End();
        }
        public override void draw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, Microsoft.Xna.Framework.Graphics.GraphicsDevice graphicsDevice)
        {
            spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, null, null, null, null, publicStatics.spriteScale);
            //Background
            spriteBatch.Draw(Image.howToPlayMenu, new Rectangle(0, 0, publicStatics.screenSize.Width, publicStatics.screenSize.Height), Color.White);

            //Draw all labels
            for(int i = 0; i < labels.Count; i++)
            {
                labels[i].Draw(spriteBatch);
            }

            //Draw all Buttons
            for (int i = 0; i < buttons.Count; i++)
            {
                buttons[i].Draw(spriteBatch);
            }

            //Draw all Checkboxes
            for (int i = 0; i < checkboxes.Count; i++)
            {
                checkboxes[i].Draw(spriteBatch);
            }

            //Draw Mouse Cursor
            cursor.drawTexture(spriteBatch, graphicsDevice);
            spriteBatch.End();
        }
Exemplo n.º 15
0
 public override void DrawWorld(Microsoft.Xna.Framework.Graphics.SpriteBatch batch)
 {
     batch.Begin();
     //batch.Draw(texture, Position, Color.Red);
     nBuild.nGon(batch, Screen.RelationToPosition(Position), 10, 3, (float)Math.Atan2(Velocity.Y, Velocity.X));
     batch.End();
 }
Exemplo n.º 16
0
        public override void DrawWorld(Microsoft.Xna.Framework.Graphics.SpriteBatch batch)
        {
            batch.Begin();
               //batch.Draw(texture, Position, Color.Purple);
               nBuild.nGon(batch, Screen.RelationToPosition(Position), radius * 300, Health+2, Rotation);

               batch.End();
        }
Exemplo n.º 17
0
        protected override void DrawAbovePlayers(Microsoft.Xna.Framework.Graphics.SpriteBatch sb)
        {
            sb.Begin(SpriteSortMode.Immediate, BlendState.NonPremultiplied, null, null, null, null, World.CamTransform);

            sb.DrawString(ArtAssets.WorldFont, "Blah", Vector2.Zero, Color.White, 0.0f, Vector2.Zero, WorldData.ZoomScaleAmount[World.CurrentZoom], SpriteEffects.None, 1.0f);

            sb.End();
        }
Exemplo n.º 18
0
        public override void DrawWorld(Microsoft.Xna.Framework.Graphics.SpriteBatch batch)
        {
            batch.Begin();

            //batch.Draw(texture, Position, Color.Purple);
            nBuild.nGon(batch, Screen.RelationToPosition(Position), 30, Health+2, (float)Math.PI * Time.WorldTime);

            batch.End();
        }
        public void Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, Microsoft.Xna.Framework.Vector2 location)
        {
            Rectangle destinationRectangle = new Rectangle((int)location.X, (int)location.Y,
                (int)BlockSpriteConstants.GENERICBLOCKDIMENSIONS.X, (int)BlockSpriteConstants.GENERICBLOCKDIMENSIONS.Y);

            spriteBatch.Begin(SpriteSortMode.Deferred, null, null, null, null, null, ScreenScaler.ScalingMatrix);
            spriteBatch.Draw(spriteSheet, destinationRectangle, sourceRectangle, Color.White);
            spriteBatch.End();
        }
Exemplo n.º 20
0
 public override void Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch Sb, Graphics.PrimitiveRenderer Pr)
 {
     Sb.Begin();
     StringBuilder str = new StringBuilder();
     str.AppendLine("Accent");
     str.AppendLine("Press 'space' to start!");
     Sb.DrawString(sysFont, str, titlePos, Color.White);
     Sb.End();
 }
Exemplo n.º 21
0
 public override void Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch sprite)
 {
     //base.Draw(sprite);
     sprite.Begin();
     sprite.Draw(texture, drawVector, Color.White);
     sprite.Draw(texture, drawVector + new Vector2(width/2, height/2), null, Color.White, -degree, new Vector2(width/2, height/2), new Vector2(1, 1), SpriteEffects.None, 0);
     //sprite.Draw(texture, drawVector + new Vector2(-48,-48), null, Color.White, -degree, new Vector2(48,48), new Vector2(1, 1), SpriteEffects.None, 0);
     sprite.End();
 }
Exemplo n.º 22
0
 public override void Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch SB)
 {
     SB.Begin();
     CResourceManager.GetInstance().GetResource(IDResource.BLACK).Draw(SB);
     CResourceManager.GetInstance().GetResource(IDResource.INTRO_1).Draw(SB);
     CResourceManager.GetInstance().GetResource(IDResource.INTRO_2).Draw(SB);
     SB.End();
     base.Draw(SB);
 }
Exemplo n.º 23
0
 public override void Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch SB)
 {
     SB.Begin();
     CResourceManager.GetInstance().GetResource(IDResource.OPTION).Draw(SB);
     for (int i = 0; i < ListButtons.Count; i++)
         ListButtons[i].Draw(SB);
     CResourceManager.GetInstance().GetResource(IDResource.ICON).Draw(SB);
     SB.End();
     base.Draw(SB);
 }
Exemplo n.º 24
0
        public override void DrawWorld(Microsoft.Xna.Framework.Graphics.SpriteBatch batch)
        {
            batch.Begin();

            Vector2 shapePos = new Vector2(Screen.X - 0.15f, Screen.Y - 0.20f);
            Vector2 textPos = new Vector2(-Screen.X + 0.05f, Screen.Y - 0.15f);
            //batch.DrawString(font, IntermissionScreen[levelNo], Screen.RelationToPosition(textPos), Color.White);

            batch.End();
        }
Exemplo n.º 25
0
 public override void DrawWorld(Microsoft.Xna.Framework.Graphics.SpriteBatch batch)
 {
     if (startup <= 1)
     {
         builder.PolyColor = Color.Lerp(Color.White, Color.Transparent, 0.5f + (float)Math.Sin(startup * Math.PI * 6 + (Math.PI / 2))/2.0f);
         batch.Begin();
         builder.nGon(batch, Screen.RelationToPosition(Position), 10f, 4, 0);
         batch.End();
     }
 }
        public override void Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch, PrimitiveDrawer primitiveDrawer, FontHandler fontHandler, Microsoft.Xna.Framework.Graphics.GraphicsDevice graphicsDevice)
        {
            SetWidth((int)fontHandler.GetVerdana().MeasureString(this.eventName).X + 8);
            Vector2 adjust = GetVector();
            adjust.X += 4;
            spriteBatch.DrawString(fontHandler.GetVerdana(), this.eventName, adjust + TetrisGameRunner.GetOffsetVector(), Color.White);

            primitiveDrawer.DrawRoundedRectangle(graphicsDevice, this, Color.Green);
            spriteBatch.End();
            spriteBatch.Begin();
        }
Exemplo n.º 27
0
 /// <summary>Отрисовывает</summary>
 /// <param name="spriteBatch">The sprite batch.</param>
 public override void Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch)
 {
     spriteBatch.Begin();
       if (mAlphaValue != 0)
     spriteBatch.Draw(Background, Rect, new Color(255, 255, 255, (byte)MathHelper.Clamp(mAlphaValue, 0, 255)));
       else if (Cycle > 100)
     spriteBatch.Draw(Background, Rect, new Color(fadeOut, 0, 0));
       else
     spriteBatch.Draw(Background, Rect, Color.White);
       spriteBatch.End();
 }
Exemplo n.º 28
0
 void DCSG_OnDraw(Microsoft.Xna.Framework.Graphics.SpriteBatch sb)
 {
     sb.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied, SamplerState.PointClamp, DCSG.MainObject.GraphicsDevice.DepthStencilState, DCSG.MainObject.GraphicsDevice.RasterizerState);
     int heightOffset = 0;
     for (int i = 0; i < debugLines.Count; i++)
     {
         sb.WriteString(debugFont, debugLines[i].text, 3, heightOffset + 3, Color.White, 2f);
         heightOffset += 18;
     }
     sb.End();
 }
Exemplo n.º 29
0
 public void Draw(Microsoft.Xna.Framework.GameTime gametime, Microsoft.Xna.Framework.Graphics.SpriteBatch spritebatch, GraphicsDevice graphics)
 {
     string text = "";
     for (int i = 0; i < credits.Count; i++)
     {
         text += credits[i] + "\n";
     }
     spritebatch.Begin();
     spritebatch.Draw(bgTex, bgrect, Color.White);
     spritebatch.DrawString(font, text, pos, Color.White);
     spritebatch.End();
 }
Exemplo n.º 30
0
 public void Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch _spritebatch)
 {
     if (this.m_numsprite.IsShow == false)
         return;
     //base.Draw(_spritebatch);
     _spritebatch.Begin();
     this.Sprite.CurFrameW = 10;
     this.Sprite.Position = this.m_position - new Vector2(this.Sprite.Frame.Width, 0);
     this.Sprite.Draw(_spritebatch);
     this.Sprite.Position = this.m_position;
     _spritebatch.End();
     m_numsprite.Draw(_spritebatch);
 }