コード例 #1
0
 public override void Draw(TGPASpriteBatch spriteBatch, Texture2D texture)
 {
     if (speedY > 0) //Hack :')
     {
         spriteBatch.Draw(texture, dRect, sRect, Color.White, 0.0f, Vector2.Zero, SpriteEffects.None, 1.0f);
     }
 }
コード例 #2
0
        public override void Draw(TGPASpriteBatch sprite, Texture2D tex)
        {
            Rectangle sRect = new Rectangle(flag * 64, 320, 64, 64);

            float frameAlpha;

            if (frame > 0.9f)
            {
                frameAlpha = (1.0f - frame) * 10.0f;
            }
            else
            {
                frameAlpha = (frame / 0.9f);
            }

            a = frameAlpha;

            sprite.Draw(tex,
                        GameLocation,
                        sRect,
                        particuleColor,
                        rotation,
                        new Vector2(32.0f, 32.0f),
                        size,
                        SpriteEffects.None,
                        1.0f);
        }
コード例 #3
0
        public void DrawParticles(TGPASpriteBatch spriteBatch, bool background)
        {
            spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend);

            foreach (Particle p in particles)
            {
                if (p != null)
                {
                    if (!p.Additive && p.Background == background)
                    {
                        p.Draw(spriteBatch, particuleTex);
                    }
                }
            }

            spriteBatch.End();

            spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Additive);

            foreach (Particle p in particles)
            {
                if (p != null)
                {
                    if (p.Additive && p.Background == background)
                    {
                        p.Draw(spriteBatch, particuleTex);
                    }
                }
            }

            spriteBatch.End();
        }
コード例 #4
0
            public override void Draw(TGPASpriteBatch spriteBatch)
            {
                TGPAContext.Instance.TextPrinter.Color = Color.Black;
                TGPAContext.Instance.TextPrinter.Size  = 1.1f;
                TGPAContext.Instance.TextPrinter.Write(spriteBatch, 240, TGPAContext.Instance.TitleSafeArea.Top + 255, "Special thanks", 52);

                //XNA reviewers
                TGPAContext.Instance.TextPrinter.Write(spriteBatch, 150, TGPAContext.Instance.TitleSafeArea.Top + 100, "XNA Peer-reviewers and playtesters", 152);

                TGPAContext.Instance.TextPrinter.Color = Color.DarkGreen;
                TGPAContext.Instance.TextPrinter.Size  = 0.8f;
                TGPAContext.Instance.TextPrinter.Write(spriteBatch, 100, TGPAContext.Instance.TitleSafeArea.Top + 150, "Mr Helmut, Irregular Games, Stinky Badger, Bounding Box Games LLC ", 152);
                TGPAContext.Instance.TextPrinter.Write(spriteBatch, 100, TGPAContext.Instance.TitleSafeArea.Top + 180, "DaleCantwel, Quebarium inc., Blau, laurent goethals ", 152);
                TGPAContext.Instance.TextPrinter.Write(spriteBatch, 100, TGPAContext.Instance.TitleSafeArea.Top + 210, "ggaler, Eclipse Games", 152);

                TGPAContext.Instance.TextPrinter.Size  = 1f;
                TGPAContext.Instance.TextPrinter.Color = Color.Red;

                //Other
                TGPAContext.Instance.TextPrinter.Write(spriteBatch, 100, TGPAContext.Instance.TitleSafeArea.Top + 305, "Aymeric DE ABREU (Aymarick), Louis LAGRANGE (Minishlink)", 152);
                TGPAContext.Instance.TextPrinter.Write(spriteBatch, 100, TGPAContext.Instance.TitleSafeArea.Top + 350, "Morgane BERTHOU (tsu) and 3Hitcombo", 152);
                TGPAContext.Instance.TextPrinter.Write(spriteBatch, 100, TGPAContext.Instance.TitleSafeArea.Top + 420, "Canard PC, Dev-FR, IndieDB", 72);
                TGPAContext.Instance.TextPrinter.Write(spriteBatch, 100, TGPAContext.Instance.TitleSafeArea.Top + 480, "Friends and family (We love you <3)", 72);
                TGPAContext.Instance.TextPrinter.Write(spriteBatch, 150, TGPAContext.Instance.TitleSafeArea.Top + 530, "Every TGPA Player !!!", 72);
                TGPAContext.Instance.TextPrinter.Color = Color.Black;
            }
コード例 #5
0
        public override void Draw(TGPASpriteBatch spriteBatch, Texture2D texture)
        {
            dRect.X = (int)location.X;
            dRect.Y = (int)location.Y;

            spriteBatch.Draw(texture, dRect, sRect, color, -(float)rotation, spriteOrigin, flips, 1.0f);
        }
コード例 #6
0
        public override void Draw(TGPASpriteBatch spriteBatch)
        {
            //Draw canon
            dRect = ComputeDstRect(canonSrc);

            Color c = Color.White;

            if (IsHit)
            {
                c = Color.Red * 0.5f;
            }

            spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend);
            spriteBatch.Draw(this.Sprite, dRect, this.canonSrc, c, fireAngle, structureLinkPoint, Flip, 1.0f);

            //Draw structure
            dRect        = ComputeDstRect(sRect);
            dRect.X     += 26;
            this.DstRect = dRect;

            if (IsHit)
            {
                c     = (Color.Red * 0.5f);
                IsHit = false;
            }

            spriteBatch.Draw(this.Sprite, dRect, this.SrcRect, c, 0.0f, structureLinkPoint, Flip, 1.0f);
            spriteBatch.End();
        }
コード例 #7
0
        public override void Draw(TGPASpriteBatch spriteBatch)
        {
            Color c = Color.White;

            if (IsHit)
            {
                if (chocolateShieldHp > 0)
                {
                    c     = (Color.SteelBlue * 0.75f);
                    IsHit = false;
                }
                else
                {
                    c     = (Color.Red * 0.75f);
                    IsHit = false;
                }
            }

            spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend);
            //Body
            spriteBatch.Draw(this.Sprite, dRect, sRect, c, 0.0f, Vector2.Zero, Flip, 1.0f);
            //Eyes
            spriteBatch.Draw(this.Sprite, eyesDstRect, eyesSrcRect, c, 0.0f, Vector2.Zero, Flip, 1.0f);
            spriteBatch.End();

#if DEBUG
            TGPAContext.Instance.TextPrinter.Write(spriteBatch, this.location, "(" + this.attackType.ToString() + ") Chocolate : " + this.chocolateShieldHp + "| Regen in :" + this.regenCooldown);
#endif
        }
コード例 #8
0
        public override void Draw(TGPASpriteBatch spriteBatch)
        {
            Color c = Color.White;

            if (IsHit)
            {
                c     = (Color.Red * 0.75f);
                IsHit = false;
            }

            spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend);
            //draw major
            spriteBatch.Draw(theSprite, new Vector2(dRect.X, dRect.Y), bunker1Rect, c);
            //draw soldier
            for (int i = 0; i < 3; i++)
            {
                spriteBatch.Draw(theSprite, new Vector2(dRect.X + 190 + (i * 105) - offset, dRect.Y + 115), soliRect, c);
            }
            //draw bunker
            spriteBatch.Draw(theSprite, new Vector2(dRect.X, dRect.Y), bunker2Rect, c);

            //draw bumper
            if (!firing)
            {
                spriteBatch.Draw(theSprite, new Vector2(dRect.X, dRect.Y), bumper1Rect, c);
            }
            else
            {
                spriteBatch.Draw(theSprite, new Vector2(dRect.X, dRect.Y), bumper2Rect, c);
            }

            spriteBatch.End();
        }
コード例 #9
0
        /// <summary>
        /// Draw the pattern of the specified enemy
        /// </summary>
        /// <param name="spriteBatch"></param>
        /// <param name="badguy"></param>
        public static void DrawMovePattern(TGPASpriteBatch spriteBatch, BadGuy badguy, List <Node> nodes)
        {
            if (badguy.Pattern == null)
            {
                return;
            }

            for (int i = 0; i < badguy.Pattern.Points.Count; i++)
            {
                bool  first     = true;
                Point lastPoint = Point.Zero;

                foreach (Node n in nodes)
                {
                    //Draw line between node and player
                    if (first)
                    {
                        first = false;
                        Node.DrawLine(spriteBatch, new Point((int)badguy.Location.X, (int)badguy.Location.Y), n.Point);
                    }
                    else
                    {
                        //Draw lines between 2 points
                        Node.DrawLine(spriteBatch, lastPoint, n.Point);
                    }
                    n.Draw(spriteBatch);
                    lastPoint = n.Point;
                }
            }
        }
 /// <summary>
 /// Draw the background images to the screen
 /// </summary>
 /// <param name="theSpriteBatch"></param>
 public void Draw(TGPASpriteBatch theSpriteBatch)
 {
     foreach (BackgroundPart aBackgroundSprite in mBackgroundSprites)
     {
         aBackgroundSprite.Draw(theSpriteBatch);
     }
 }
 /// <summary>
 /// Draw the sprite on the screen with specified dimensions (used in map editor)
 /// </summary>
 /// <param name="theSpriteBatch"></param>
 /// <param name="screenWidth"></param>
 /// <param name="screenHeight"></param>
 public void Draw(TGPASpriteBatch theSpriteBatch, int screenWidth, int screenHeight)
 {
     foreach (BackgroundPart aBackgroundSprite in mBackgroundSprites)
     {
         aBackgroundSprite.Draw(theSpriteBatch, screenWidth, screenHeight);
     }
 }
コード例 #12
0
        public void Draw(Rectangle dRect, TGPASpriteBatch spriteBatch)
        {
            //Draw element
            if (sRect != Rectangle.Empty)
            {
                spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend);
                spriteBatch.Draw(sprite, dRect, sRect, Color.White);
                spriteBatch.End();
            }

            Vector2 textLoc = new Vector2(dRect.X, dRect.Y);

            string text;

            if (label == null)
            {
                text = value.ToString();
            }
            else
            {
                text = LocalizedStrings.GetString(label);
            }

            dRect.Width  = text.Length + 20;
            dRect.Height = 20;

            TGPAContext.Instance.TextPrinter.Write(spriteBatch, textLoc.X, textLoc.Y, text, 1024);
        }
コード例 #13
0
        public virtual void Draw(TGPASpriteBatch spriteBatch, Texture2D texture)
        {
            dRect.X = (int)location.X;
            dRect.Y = (int)location.Y;

            Rectangle dstShotBehind = dRect;

            dstShotBehind.Width  = (int)((float)dstShotBehind.Width * 1.2f);
            dstShotBehind.Height = (int)((float)dstShotBehind.Height * 1.2f);

            Color shotColor = Color.White;

            if (this.IsHit)
            {
                shotColor  = Color.Red;
                this.IsHit = false;
            }

            if (this.EnemyFire)
            {
                if (this.DrawBehindShot)
                {
                    spriteBatch.Draw(texture, dstShotBehind, sRect, this.behindColor, -(float)rotation, spriteOrigin, this.flips, 1.0f);
                }
                spriteBatch.Draw(texture, dRect, sRect, shotColor, -(float)rotation, spriteOrigin, this.flips, 1.0f);
            }
            else
            {
                if (this.DrawBehindShot)
                {
                    spriteBatch.Draw(texture, dstShotBehind, sRect, this.behindColor, -(float)rotation, spriteOrigin, SpriteEffects.None, 1.0f);
                }
                spriteBatch.Draw(texture, dRect, sRect, Color.White, -(float)rotation, spriteOrigin, SpriteEffects.None, 1.0f);
            }
        }
コード例 #14
0
 public override void Draw(TGPASpriteBatch spriteBatch)
 {
     TGPAContext.Instance.TextPrinter.Color = Color.Black;
     TGPAContext.Instance.TextPrinter.Size  = 1.2f;
     TGPAContext.Instance.TextPrinter.Write(spriteBatch, 390, TGPAContext.Instance.TitleSafeArea.Top + 550, " Poulpis killed : " + TGPAContext.Instance.Saver.SaveData.KilledPoulpis, 72);
     TGPAContext.Instance.TextPrinter.Size = 1f;
 }
コード例 #15
0
        public void Draw(TGPASpriteBatch spriteBatch)
        {
            //White background
            spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend);
            spriteBatch.Draw(TGPAContext.Instance.NullTex, new Rectangle(0, 0, TGPAContext.Instance.ScreenWidth, TGPAContext.Instance.ScreenHeight), Color.White);
            spriteBatch.End();

            //Draw 1024*768 image in center
            Rectangle dst = new Rectangle(0, 0, 1024, 768);

            dst.X = TGPAContext.Instance.ScreenWidth / 2 - dst.Width / 2;
            dst.Y = TGPAContext.Instance.ScreenHeight / 2 - dst.Height / 2;

            spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend);
            spriteBatch.Draw(background, dst, Color.White);
            spriteBatch.End();

            //Draw fade in/out
            if (fadeInOut > 0f)
            {
                Color blackScreen = new Color(Color.Black.R, Color.Black.G, Color.Black.B, this.fadeInOut);

                spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend);
                spriteBatch.Draw(TGPAContext.Instance.NullTex, new Rectangle(0, 0, TGPAContext.Instance.ScreenWidth, TGPAContext.Instance.ScreenHeight), blackScreen);
                spriteBatch.End();
            }
        }
コード例 #16
0
 public override void Draw(TGPASpriteBatch spriteBatch)
 {
     TGPAContext.Instance.TextPrinter.Color = Color.Black * alpha;
     TGPAContext.Instance.TextPrinter.Size  = 1.5f;
     TGPAContext.Instance.TextPrinter.Write(spriteBatch, location.X, location.Y, texte, 128);
     TGPAContext.Instance.TextPrinter.Color = Color.Black;
     TGPAContext.Instance.TextPrinter.Size  = 1f;
 }
コード例 #17
0
            public override void Draw(TGPASpriteBatch spriteBatch)
            {
                TGPAContext.Instance.ButtonPrinter.Draw(spriteBatch, button, TGPAContext.Instance.Player1.Device.Type, locationP1, Color.White * alphaColor);

                TGPAContext.Instance.TextPrinter.Color = Color.Black * alphaColor;
                TGPAContext.Instance.TextPrinter.Write(spriteBatch, locationP1.X + ((button == "#Move" && TGPAContext.Instance.Player1.Device.Type == DeviceType.KeyboardMouse) ? 150 : 50), locationP1.Y, LocalizedStrings.GetString(button.Replace("#", "Player")), 128);
                TGPAContext.Instance.TextPrinter.Color = Color.Black;
            }
コード例 #18
0
 public override void Draw(TGPASpriteBatch sprite, Texture2D tex)
 {
     sprite.Draw(tex, GameLocation,
                 new Rectangle(0, 128, 64, 64),
                 this.particuleColor,
                 rotation, new Vector2(32.0f, 32.0f),
                 new Vector2(1f, 0.1f),
                 SpriteEffects.None, 1.0f);
 }
コード例 #19
0
        public override void Draw(TGPASpriteBatch spriteBatch)
        {
            double updateRotation = rotation;

            this.rotation -= Math.PI / 4;

            base.Draw(spriteBatch);

            this.rotation = updateRotation;
        }
コード例 #20
0
        public void Draw(TGPASpriteBatch spriteBatch, Texture2D bonus_sprites)
        {
            this.color = Color.White * alpha;

            spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend);

            spriteBatch.Draw(bonus_sprites, dRect, sRect, color);

            spriteBatch.End();
        }
コード例 #21
0
        public override void Draw(TGPASpriteBatch spriteBatch)
        {
            double tmpRotation = this.rotation;

            this.rotation = this.visualRotation;

            base.Draw(spriteBatch);

            this.rotation = tmpRotation;
        }
コード例 #22
0
        public override void Draw(TGPASpriteBatch spriteBatch)
        {
            Rectangle rect = new Rectangle(
                (int)square.Min.X, (int)square.Min.Y,
                (int)square.Max.X - (int)square.Min.X, (int)square.Max.Y - (int)square.Min.Y
                );

            spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend);
            spriteBatch.Draw(TGPAContext.Instance.NullTex, rect, Color.Red * 0.5f);
            spriteBatch.End();
        }
コード例 #23
0
            public override void Draw(TGPASpriteBatch spriteBatch)
            {
                spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend);

                spriteBatch.Draw(TGPAContext.Instance.NullTex,
                                 new Rectangle(0, 0, TGPAContext.Instance.ScreenWidth, TGPAContext.Instance.ScreenHeight), Color.White * alphaFadeOut);

                spriteBatch.End();

                base.Draw(spriteBatch);
            }
コード例 #24
0
        public override void Draw(TGPASpriteBatch sprite, Texture2D tex)
        {
            if (frame > 0.5f)
            {
                return;
            }

            Rectangle sRect  = new Rectangle(flag * 64, 64, 64, 64);
            float     bright = frame * 0.5f;
            float     tsize;

            if (frame > 0.4f)
            {
                r = 1.0f;
                g = 1.0f;
                b = (frame - 0.4f) * 10.0f;

                if (frame > 0.45f)
                {
                    tsize = (0.5f - frame) * size * 20.0f;
                }
                else
                {
                    tsize = size;
                }
            }
            else if (frame > 0.3f)
            {
                r     = 1.0f;
                g     = (frame - 00.0f) * 10.0f;
                b     = 0.0f;
                tsize = size;
            }
            else
            {
                r     = frame * 3.3f;
                g     = 0.0f;
                b     = 0.0f;
                tsize = (frame * 0.3f) * size;
            }

            if (flag % 2 == 0)
            {
                rotation = (frame * 7.0f + size * 20.0f);
            }
            else
            {
                rotation = (-frame * 11.0f + size * 20.0f);
            }

            sprite.Draw(tex, GameLocation, sRect, particuleColor, rotation,
                        new Vector2(32.0f, 32.0f), tsize, SpriteEffects.None, 0.0f);
        }
コード例 #25
0
            public override void Draw(TGPASpriteBatch spriteBatch)
            {
                //Do not draw

#if DEBUG
                //Except hitbox in debug mode
                if (TGPAContext.Instance.Options.DebugMode)
                {
                    this.hitbox.Draw(spriteBatch);
                }
#endif
            }
コード例 #26
0
        public void Draw(TGPASpriteBatch spriteBatch)
        {
            spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend);
            spriteBatch.Draw(videoBackground, new Rectangle(0, 0, TGPAContext.Instance.ScreenWidth, TGPAContext.Instance.ScreenHeight), Color.White);
            spriteBatch.End();

            if (playVideo)
            {
                TGPAContext.Instance.TextPrinter.Color = Color.White;

                if (this.videoPlayer.State == MediaState.Playing)
                {
                    //Display video
                    spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend);
                    spriteBatch.Draw(this.videoPlayer.GetTexture(), this.videoDst, Color.White);
                    spriteBatch.End();
                }
            }
            else if (playCredits)
            {
                TGPAContext.Instance.TextPrinter.Color = Color.Black;

                spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend);

                if (currentPageIndex > 0)
                {
                    spriteBatch.Draw(backgrounds[currentPageIndex - 1], bgDst, Color.White);
                }

                spriteBatch.Draw(backgrounds[currentPageIndex], bgDst, new Color(Color.White.R, Color.White.G, Color.White.B, transitionAlpha));

                spriteBatch.End();

                this.pages[currentPageIndex].Draw(spriteBatch);
            }

            if (playVideo)
            {
                TGPAContext.Instance.TextPrinter.Color = Color.White;
            }
            else
            {
                TGPAContext.Instance.TextPrinter.Color = Color.Navy;
            }
            TGPAContext.Instance.ButtonPrinter.Draw(spriteBatch, "#Back", TGPAContext.Instance.Player1.Device.Type, new Vector2(750, TGPAContext.Instance.ScreenHeight - 110));
            TGPAContext.Instance.TextPrinter.Write(spriteBatch, new Vector2(800, TGPAContext.Instance.ScreenHeight - 100), LocalizedStrings.GetString("CreditsScreenLeave"));

            TGPAContext.Instance.ButtonPrinter.Draw(spriteBatch, "#Confirm", TGPAContext.Instance.Player1.Device.Type, new Vector2(750, TGPAContext.Instance.ScreenHeight - 55));
            TGPAContext.Instance.TextPrinter.Write(spriteBatch, new Vector2(800, TGPAContext.Instance.ScreenHeight - 45), LocalizedStrings.GetString("CreditsScreenNext"));

            TGPAContext.Instance.TextPrinter.Color = Color.Black;
        }
コード例 #27
0
        public override void Draw(TGPASpriteBatch spriteBatch)
        {
            Rectangle dRect = this.SrcRect;

            dRect.X = (int)location.X;
            dRect.Y = (int)location.Y;

            spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend);

            spriteBatch.Draw(Sprite, dRect, sRect, Color.White, (float)rotation, Vector2.Zero, Flip, 1.0f);

            spriteBatch.End();
        }
コード例 #28
0
        public override void Draw(TGPASpriteBatch spriteBatch)
        {
            Rectangle dstBehind = dRect;

            dstBehind.Width  = (int)((float)dstBehind.Width * 1.4f);
            dstBehind.Height = (int)((float)dstBehind.Height * 1.4f);

            spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend);
            spriteBatch.Draw(this.Sprite, dstBehind, this.SrcRect, Color.SeaShell * 0.8f, 0.0f, this.spriteOrigin, Flip, 1.0f);
            spriteBatch.End();

            base.Draw(spriteBatch);
        }
コード例 #29
0
        public override void Draw(TGPASpriteBatch sprite, Texture2D tex)
        {
            Rectangle sRect = new Rectangle(flag * 64, 0, 64, 64);

            sprite.Draw(tex,
                        GameLocation,
                        sRect,
                        particuleColor,
                        rotation,
                        new Vector2(32.0f, 32.0f),
                        size + (1.0f - frame),
                        SpriteEffects.None,
                        1.0f);
        }
コード例 #30
0
        public override void Draw(TGPASpriteBatch spriteBatch)
        {
            Color c = Color.White;

            if (IsHit)
            {
                c     = (Color.Red * 0.75f);
                IsHit = false;
            }

            spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend);
            spriteBatch.Draw(this.Sprite, dRect, sRect, c, 0.0f, Vector2.Zero, Flip, 1.0f);
            spriteBatch.End();
        }