title: libgdx sprite suddenly not rendering, with custom world units
body: <p>I want to render card sprites using custom units. <code>1 world unit = 1 card</code> width, <a href="https://xoppa.github.io/blog/a-simple-card-game/" rel="nofollow noreferrer">like is done here</a><br>
  But the sprite is not rendering. This was working before, but I wonder why its not now. It just renders a blank screen.</p>
  
  <pre><code>import com.badlogic.gdx.ApplicationAdapter;
  import com.badlogic.gdx.Gdx;
  import com.badlogic.gdx.graphics.GL20;
  import com.badlogic.gdx.graphics.OrthographicCamera;
  import com.badlogic.gdx.graphics.g2d.Sprite;
  import com.badlogic.gdx.graphics.g2d.SpriteBatch;
  import com.badlogic.gdx.graphics.g2d.TextureAtlas;
  
  public class MyGame extends ApplicationAdapter {
      SpriteBatch batch;
      Sprite sprite;
      TextureAtlas atlas;
      OrthographicCamera cam;
      float CARDWITH=1f;//chosen as our world unit
      float CARDHEIGHT=108f/76f;
      float MINIMUM_VIEWPORT_SIZE=10f;//our viewport is 10 card widths wide
      @Override
      public void create () {
          batch = new SpriteBatch();
          atlas=new TextureAtlas(Gdx.files.internal("cardspack.atlas"));
          sprite=atlas.createSprite("c2");
          sprite.setSize(CARDWITH,CARDHEIGHT);//make 1 unit of our world equal to 1 card width.
          cam=new OrthographicCamera();
      }
  
      @Override
      public void resize(int width, int height) {
          if(width&gt;height){
              cam.viewportHeight=MINIMUM_VIEWPORT_SIZE;
              cam.viewportWidth=cam.viewportHeight*(float)width/(float)height;
          }
          else {
              cam.viewportWidth=MINIMUM_VIEWPORT_SIZE;
              cam.viewportHeight=cam.viewportWidth*(float)height/(float)width;
          }
          cam.update();
      }
  
      @Override
      public void render () {
          Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
          batch.begin();
          sprite.draw(batch);
          batch.end();
      }
  
      @Override
      public void dispose () {
          batch.dispose();
      }
  }
  </code></pre>
  
  <p><a href="http://pastebin.com/K30eFuhF" rel="nofollow noreferrer">Here is the texture atlas cardspack.atlas</a>
  here is a <a href="https://i.stack.imgur.com/FTiWc.png" rel="nofollow noreferrer">link to the image of cardspack</a></p>