Draw() public method

public Draw ( SpriteBatch sb ) : void
sb Microsoft.Xna.Framework.Graphics.SpriteBatch
return void
        public static void DrawPlayer_RenderAllLayers(PlayerDrawHeadSet drawinfo)
        {
            List <DrawData> drawData    = drawinfo.DrawData;
            Effect          pixelShader = Main.pixelShader;

            _ = Main.projectile;
            SpriteBatch spriteBatch = Main.spriteBatch;

            for (int i = 0; i < drawData.Count; i++)
            {
                DrawData cdd = drawData[i];
                if (!cdd.sourceRect.HasValue)
                {
                    cdd.sourceRect = cdd.texture.Frame();
                }
                PlayerDrawHelper.SetShaderForData(drawinfo.drawPlayer, drawinfo.cHead, cdd);
                if (cdd.texture != null)
                {
                    cdd.Draw(spriteBatch);
                }
            }
            pixelShader.CurrentTechnique.Passes[0].Apply();
        }
Ejemplo n.º 2
0
        public static void DrawPlayer_RenderAllLayers(ref PlayerDrawHeadSet drawinfo)
        {
            List <DrawData> drawData    = drawinfo.DrawData;
            Effect          pixelShader = Main.pixelShader;

            Projectile[] projectile  = Main.projectile;
            SpriteBatch  spriteBatch = Main.spriteBatch;

            for (int index = 0; index < drawData.Count; ++index)
            {
                DrawData cdd = drawData[index];
                if (!cdd.sourceRect.HasValue)
                {
                    cdd.sourceRect = new Rectangle?(cdd.texture.Frame(1, 1, 0, 0, 0, 0));
                }
                PlayerDrawHelper.SetShaderForData(drawinfo.drawPlayer, drawinfo.cHead, ref cdd);
                if (cdd.texture != null)
                {
                    cdd.Draw(spriteBatch);
                }
            }
            pixelShader.CurrentTechnique.Passes[0].Apply();
        }