コード例 #1
0
ファイル: RopeTool.cs プロジェクト: guozanhua/KinectRagdoll
 public override void Draw(SpriteBatch sb)
 {
     if (startBody != null)
     {
         SpriteHelper.DrawLine(sb, ProjectionHelper.FarseerToPixel(startBody.GetWorldPoint(startBodyLocal)), game.inputManager.inputHelper.MousePosition, 2f, Color.Blue);
     }
 }
コード例 #2
0
ファイル: Obelisk.cs プロジェクト: pfarrel/TiberianStrike
        public override void Draw(SpriteBatch spriteBatch)
        {
            base.Draw(spriteBatch);

            if (state == ObeliskState.Firing)
            {
                SpriteHelper.DrawLine(spriteBatch, PositionVector - new Vector2(2, 17), target.PositionVector, Color.Red, ZOrder.Projectiles);
            }
        }
コード例 #3
0
ファイル: A10.cs プロジェクト: pfarrel/TiberianStrike
        public override void Draw(SpriteBatch spriteBatch)
        {
            int x = Position.X - Sprites.A10.Width / 2;
            int y = Position.Y - Sprites.A10.Height / 2;

            spriteBatch.Draw(Sprites.Shadow.Texture, new Rectangle(x, y + FlyingHeight, Sprites.Shadow.Width, Sprites.Shadow.Height), Color.White);

            if (TsGame.DebugEnabled)
            {
                SpriteHelper.DrawLine(spriteBatch, PositionVector, VectorHelpers.MoveInDirection(PositionVector, Rotation, 50), Color.White, ZOrder.Debug);
            }

            base.Draw(spriteBatch);
        }
コード例 #4
0
        /*protected override bool shouldFire(Vector3 hand, Vector3 handVel, Vector3 shoulder)
         * {
         *  if (handVel.Length() > SPEED_THRESHOLD)
         *  {
         *
         *
         *      Vector2 shoulderToHand = hand - shoulder;
         *      if (shoulderToHand.Length() > EXTENSION_THRESHOLD)
         *      {
         *          handVel.Normalize();
         *          shoulderToHand.Normalize();
         *          if (Vector2.Dot(handVel, shoulderToHand) > .6f)
         *          {
         *              Console.WriteLine("Silked ");
         *              return true;
         *          }
         *          else
         *          {
         *              Console.WriteLine("Off Kilter");
         *          }
         *      }
         *      else
         *      {
         *          Console.WriteLine("Not extended " + shoulderToHand.Length());
         *      }
         *  }
         *
         *
         *
         *  return false;
         * }*/

        public override void Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch sb)
        {
            base.Draw(sb);

            if (leftSilk != null)
            {
                SpriteHelper.DrawLine(sb, leftSilk.WorldAnchorA, leftSilk.WorldAnchorB, .2f, Color.Orange);
            }

            if (rightSilk != null)
            {
                SpriteHelper.DrawLine(sb, rightSilk.WorldAnchorA, rightSilk.WorldAnchorB, .2f, Color.Orange);
            }
        }
コード例 #5
0
        public override void Draw(SpriteBatch sb)
        {
            Vector2 fireVec     = new Vector2((float)Math.Cos(body.Rotation), (float)Math.Sin(body.Rotation));
            Vector2 fireLoc     = body.Position + fireVec * (barrelLength + .3f);
            Vector2 endPosition = body.Position + fireVec * 20;

            if (state == State.Firing)
            {
                Color c = new Color(1, 0, 0, (chargeTime - chargeCount) * 1.0f / chargeTime);
                SpriteHelper.DrawLine(sb, fireLoc, endPosition, .1f, c);
            }

            if (glowCount > 0)
            {
                glowCount--;
                SpriteHelper.DrawLine(sb, fireLoc, stoppingPoint, .4f, Color.Red);
            }
        }
コード例 #6
0
        public override void Draw(SpriteBatch sb)
        {
            if (polyPoints.First != null)
            {
                LinkedListNode <Vector2> a = polyPoints.First;
                LinkedListNode <Vector2> b = polyPoints.First.Next;

                while (b != null)
                {
                    SpriteHelper.DrawLine(sb, ProjectionHelper.FarseerToPixel(a.Value), ProjectionHelper.FarseerToPixel(b.Value), 2f, Color.Black);

                    a = b;
                    b = b.Next;
                }

                SpriteHelper.DrawLine(sb, ProjectionHelper.FarseerToPixel(a.Value), game.inputManager.inputHelper.MousePosition, 2f, Color.Blue);
            }
        }