title: Libgdx - not implementing Screen
body: <pre><code>public class MenuState extends State {
  private OrthographicCamera camera;
  private Viewport viewport;
  private MenuButtons playButton;
  
  public MenuState(GameStateManager gsm, int tryscore, AssetsClass assetsClass, PreferencesHelper preferencesHelper) {
      super(gsm);
  
      camera = new OrthographicCamera();
      viewport = new FitViewport(ButtonCrash.V_WIDTH, ButtonCrash.V_HEIGHT, camera);
      viewport.apply();
  
      playButton = new MenuButtons(assetsClass.getManager().get("mainmenu/button_play.png", Texture.class), 1);
      playButton.getButton().setSize(200, 200);
      playButton.getButton().setPosition(-100, -100);
  }
  @Override
  protected void handlingInput() {
  
  }
  
  @Override
  public void update(float delta) {
      camera.update();
  }
  
  @Override
  public void render(SpriteBatch sb) {
      sb.setProjectionMatrix(camera.combined);
      sb.begin();
      playButton.getButton().draw(sb);
      sb.end();
  }
  
  @Override
  public void dispose() {
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>And well the camera works nice, but the viewports don't, it is like they are not there!</p>
  
  <p>I actually copied everything about the code I even tried in constructor:</p>
  
  <pre><code>viewport.update(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
  </code></pre>
  
  <p>But it seems as like because I am not implementing the Screen the code doesn't work. The thing is I made my game without Game and Screen interface, but made my own State class. What might be the problem here?</p>