Esempio n. 1
0
        public override bool PreDraw(SpriteBatch spriteBatch, Color drawColor)
        {
            if (nest == null)
            {
                return(false);
            }
            DragonData data = nest.Dragon.data;
            Texture2D  tex  = GetTexture("StarlightRiver/Items/Dragons/Egg");
            Texture2D  tex2 = GetTexture("StarlightRiver/Items/Dragons/EggOver");

            spriteBatch.Draw(tex, npc.Center - Main.screenPosition, tex.Frame(), data.scaleColor.MultiplyRGB(drawColor), npc.rotation, new Vector2(tex.Width / 2, tex.Height), 1, 0, 0);
            spriteBatch.Draw(tex2, npc.Center - Main.screenPosition, tex2.Frame(), data.bellyColor.MultiplyRGB(drawColor), npc.rotation, new Vector2(tex.Width / 2, tex.Height), 1, 0, 0);
            return(false);
        }
        public override bool Draw(List <DrawData> playerDrawData, int drawType, Player drawPlayer, ref Texture2D texture, ref Texture2D glowTexture, ref Vector2 drawPosition, ref Rectangle frame, ref Color drawColor, ref Color glowColor, ref float rotation, ref SpriteEffects spriteEffects, ref Vector2 drawOrigin, ref float drawScale, float shadow)
        {
            texture = ModContent.GetTexture("StarlightRiver/Invisible");
            DragonData    data   = drawPlayer.GetModPlayer <DragonHandler>().data;
            int           offX   = drawPlayer.direction == -1 ? 10 : -10;
            Rectangle     target = new Rectangle((int)drawPosition.X + offX, (int)drawPosition.Y, 68, 54);
            Rectangle     source = ModContent.GetTexture("StarlightRiver/Dragons/YoungDragonScale").Frame();
            SpriteEffects flip   = drawPlayer.direction == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally;

            playerDrawData.Add(new DrawData(ModContent.GetTexture("StarlightRiver/Dragons/YoungDragonScale"), target, source, data.scaleColor.MultiplyRGB(drawColor), 0, source.Size() / 2, flip, 0));
            playerDrawData.Add(new DrawData(ModContent.GetTexture("StarlightRiver/Dragons/YoungDragonBelly"), target, source, data.bellyColor.MultiplyRGB(drawColor), 0, source.Size() / 2, flip, 0));
            playerDrawData.Add(new DrawData(ModContent.GetTexture("StarlightRiver/Dragons/YoungDragonHorn"), target, source, data.hornColor.MultiplyRGB(drawColor), 0, source.Size() / 2, flip, 0));
            playerDrawData.Add(new DrawData(ModContent.GetTexture("StarlightRiver/Dragons/YoungDragonEye"), target, source, data.eyeColor.MultiplyRGB(drawColor), 0, source.Size() / 2, flip, 0));
            return(true);
        }