예제 #1
0
        public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor)
        {
            if (!inFG)             //if not in foreground stop drawing
            {
                return(false);
            }

            GetRotation(out float realRot, out SpriteEffects effect);

            Color col = Lighting.GetColor((int)(npc.Center.X / 16f), (int)(npc.Center.Y / 16f));

            spriteBatch.Draw(Main.npcTexture[npc.type], npc.Center - Main.screenPosition, npc.frame, StarjinxGlobalNPC.GetColorBrightness(col), realRot, npc.frame.Size() / 2f, 1f, effect, 0f);

            if (enchantment != Enchantment.Void)
            {
                DrawSword();
            }
            return(false);
        }
예제 #2
0
        public void DrawSword(bool gloop = false)
        {
            GetRotation(out float realRot, out SpriteEffects effect);

            if (gloop)
            {
                Main.spriteBatch.Draw(SwordExtra, (npc.Center - Main.screenPosition) / 2f, npc.frame, Color.White, realRot, npc.frame.Size() / 2f, 1 / 2f, effect, 0f);
            }
            else
            {
                Color col = Lighting.GetColor((int)(npc.Center.X / 16f), (int)(npc.Center.Y / 16f));
                Main.spriteBatch.Draw(SwordExtra, npc.Center - Main.screenPosition, npc.frame, StarjinxGlobalNPC.GetColorBrightness(col), realRot, npc.frame.Size() / 2f, 1f, effect, 0f);
            }
        }
예제 #3
0
 public override Color?GetAlpha(Color drawColor) => StarjinxGlobalNPC.GetColorBrightness(drawColor);