title: Dynamically changing Texture2D
body: <pre><code>private void occupiedcheck(Vector2 positionv, Texture2D positiont)
     {
         int xpos=(((int)positionv.X+100)/150);
         int ypos=(((int)positionv.Y+110)/150);
         for (int j = 0; j &lt; 4; j++)
         {
             if (piecexarray[j] == xpos &amp;&amp; pieceyarray[j] == ypos)
             {
  
             }
             else
             {
                 positiont = Content.Load&lt;Texture2D&gt;("Graphics/Highlighter");
                 break;
             }
         }
     }
  </code></pre>
  
  <p>Above you can see a function I've written for a C# game, I want it to change the texture that is passed into it (Texture2D positiont) to "Graphics/Highlighter", when the 'else' part of the function is activated. Currently it doesn't work, how can I get it so that I can pass an existing Texture2D into the function and change it dynamically via the 'Content.Load' method within the function.</p>