title: XNA pass SpriteBatch and Content as reference
body: <p>recently I started to use XNA with MonoMac.
  I have problem with classes.
  I want to create a class with textures and position information inside. Also I would like to make draw function.</p>
  
  <p>My idea was to pass spriteBatch and Content arround so I could load textures and draw them afterwards. However Content object i pass into this object doesnt load any textures, when I tried Content outside the class, it loaded textures fine, so textures must be there.</p>
  
  <pre><code>    public class TPlayer {
          public Texture2D[] textures;
          public ContentManager Content;
          public SpriteBatch spriteBatch;
          public int currentFrame;
          public Rectangle position;
          public TPlayer(ContentManager ccontent, SpriteBatch cspritebatch){
              this.Content = ccontent;
              this.spriteBatch = cspritebatch;
              this.Content.RootDirectory = "Content";
              this.currentFrame = 0;
              this.position = new Rectangle(250,20,100,150);
              this.LoadContent();
          }
  
          protected void LoadContent(){
              this.textures[0] = this.Content.Load&lt;Texture2D&gt;("Textures/ToughStanding");
              this.textures[1] = this.Content.Load&lt;Texture2D&gt;("Textures/ToughWalking1");
              this.textures[2] = this.Content.Load&lt;Texture2D&gt;("Textures/ToughWalking2");
          }
  
          public void Draw(){
              spriteBatch.Begin (SpriteSortMode.Deferred, BlendState.AlphaBlend);
              this.spriteBatch.Draw (textures[0], this.position, Color.White);
              this.spriteBatch.End ();
          }
  </code></pre>
  
  <p>This is how i create instance: </p>
  
  <pre><code>Player = new TPlayer(this.Content,this.spriteBatch);
  </code></pre>
  
  <p>Maybe Im trying to use wrong model.. Maybe I shouldnt want to use spritebatch and Content inside of class, but than can i make spritebatch and content global ? </p>
  
  <p>Thank you for your help</p>