Exemple #1
0
        private void DrawVertibrae(Texture2D headTexture, SpriteBatch spriteBatch, Color lightColor, Projectile head)
        {
            Vector2     endPosition = projectile.Top + new Vector2(24 * projectile.spriteDirection, -4);
            Vector2     center      = head.Center;
            ChainDrawer drawer      = new ChainDrawer(new Rectangle(6, 36, 12, 14));

            drawer.DrawChain(spriteBatch, headTexture, center, endPosition);
        }
 public override void PostDraw(SpriteBatch spriteBatch, Color lightColor)
 {
     if (IsAttacking())
     {
         Texture2D   chainTexture = GetTexture(ChainTexturePath);
         ChainDrawer drawer       = new ChainDrawer(chainTexture.Bounds);
         Vector2     center       = projectile.Center + WeaponCenterOfRotation;
         Vector2     chainVector  = UnitVectorFromWeaponAngle() * WeaponDistanceFromCenter();
         drawer.DrawChain(spriteBatch, chainTexture, center, center + chainVector, usingSpecial ? Color.White : default);
     }
     base.PostDraw(spriteBatch, lightColor);
 }
        public override bool PreDraw(SpriteBatch spriteBatch, Color lightColor)
        {
            if (TimeToLive - Projectile.timeLeft < 2)
            {
                return(false);
            }
            Texture2D   texture = Main.projectileTexture[Projectile.type];
            ChainDrawer drawer  = new ChainDrawer(GetFrame);
            // extremely arbitrary series of hardcoded ints to make the
            // beams line up with the tip of the sword
            Vector2 baseTangent = baseTangentSize * this.tangent;
            Vector2 center      = Projectile.Center + baseTangent;
            Vector2 end         = endPoint + baseTangent;

            drawer.DrawChain(spriteBatch, texture, center, end, Color.White * chargeScale);
            return(false);
        }
Exemple #4
0
        public override void PostDraw(SpriteBatch spriteBatch, Color lightColor)
        {
            Texture2D     glow       = GetTexture(Texture + "_Glow");
            float         glowR      = projectile.rotation;
            Vector2       glowpos    = projectile.Center;
            SpriteEffects effects    = projectile.spriteDirection == 1 ? 0 : SpriteEffects.FlipHorizontally;
            Rectangle     glowbounds = glow.Bounds;
            Vector2       gloworigin = glowbounds.Center.ToVector2();

            spriteBatch.Draw(glow, glowpos - Main.screenPosition,
                             glowbounds, Color.White, glowR,
                             gloworigin, 1, effects, 0);

            if (usingWeapon)
            {
                Texture2D   chainTexture = GetTexture("AmuletOfManyMinions/Projectiles/Squires/ArmoredBoneSquire/ArmoredBoneSquireFlailChain");
                ChainDrawer drawer       = new ChainDrawer(chainTexture.Bounds);
                Vector2     center       = projectile.Center + WeaponCenterOfRotation;
                Vector2     chainVector  = UnitVectorFromWeaponAngle() * WeaponDistanceFromCenter();
                drawer.DrawChain(spriteBatch, chainTexture, center, center + chainVector, Color.White);
            }
            base.PostDraw(spriteBatch, lightColor);
        }