Skip to content

StageContent

Rico Schrage edited this page May 9, 2017 · 4 revisions

While implementing the Content interface might be pretty exhausting, because you have to render everything by yourself, there is a very neat alternative for creating user interfaces (similar approach will exist for the game itself too): StageContent. The StageContent provides a very comfortable way to create an UI simply with writing some xml's. Let's start with a minimal example:

public class NiceUiContent extends StageContent {

    @Override
    protected Resource defineXML() {
        return XML_LOADING_SCREEN;
    }

    @Override
    protected Resource defineSkin() {
        return SKIN_LOADING_SCREEN;
    }
}

You need two different resources to set up a StageContent:

  1. You need a Resource, which describes a xml and has already been loaded by the ResourceHandler.
  2. You need a Resource, which describes a skin and has already been loaded by the ResourceHandler. If you fulfill both requirement you can just return your resource-descriptors in the methods and you are finished.

Creating a XML for the UI

soon...

Clone this wiki locally