How to use callbacks in my own code
<p>Here I update my world to include the canvas size</p>

<pre><code>world.getViewPort().updateViewPortSize(width,height);
</code></pre>

<p>Is there a better way to do this?  Is there a way that I can automatically update my world object without having to manually call it in the setSurfaceSize method but instead call it from My world class?</p>

<p>My guess is that I can use some sort of callback, but I don't understand them!</p>

<pre><code>/* Callback invoked when the surface dimensions change. */
public void setSurfaceSize(int width, int height) {
    // synchronized to make sure these all change atomically
    synchronized (mSurfaceHolder) {
        mCanvasWidth = width;
        mCanvasHeight = height;
        world.getViewPort().updateViewPortSize(width,height);
    }
}
</code></pre>
