Skip to content
Asbestion edited this page May 27, 2017 · 8 revisions

A Screen is meant to portray a specific visual state of the app. For example the options menu is a screen. But technically the class Screen acts much more like a intermediary between the actual app and the content. As a result the Content class is very much independent from the underlying layers. Let's take a look at the default implementation of the a screen SimpleScreen. A SimpleScreen requires an instance of Content and a viewport.

new SimpleScreen(viewport, yourContent);

There are very much two interesting things about screens in gdx-surface:

  1. Every screen can have its own viewport and will manage this viewport automatically.
  2. A screen can have two different types of transitions: in- and out-transitions. Transitions are animations which will get activated when the screen switches. The existing transitions are completely content-independent. If you want to have content dependent transitions you should use StageContent.
Clone this wiki locally