Centering on the player in a platformer
<p>im trying to work out how I would center the camera on the spawn in my platformer. So,for example if the spawn is at 7,9, which would be off the screen,how would I make it so that that tile is in the middle of the screen?</p>

<p>this is my Camera class,where I want to work out the centering</p>

<pre><code>    public class Camera {
    int offset_x;
    int offset_y;

    public Camera(int offset_x,int offset_y){
    this.offset_x = offset_x;
    this.offset_y = offset_y;
    }

    public void centerOnTile(int tx,int ty,int vw,int vh){
    }             
   }
</code></pre>

<p>vw is the width of the screen,vh is the height of the screen,tx is the x of the tile,but not the rendering x,to get that i would do tx*64 same for ty offset x and y are what is added to each tiles render x,so if i was to make offset x = 64,they would all be rendered 1 tile to the right. This is on android,if it matters at all,but any java specific ansewers should work fine,thanks for any help :)</p>
