Search in sources :

Example 6 with UIScreenLayer

use of org.terasology.rendering.nui.UIScreenLayer in project Terasology by MovingBlocks.

the class NUIManagerInternal method render.

@Override
public void render() {
    canvas.preRender();
    Deque<UIScreenLayer> screensToRender = Queues.newArrayDeque();
    for (UIScreenLayer layer : screens) {
        screensToRender.push(layer);
        if (!layer.isLowerLayerVisible()) {
            break;
        }
    }
    for (UIScreenLayer screen : screensToRender) {
        canvas.drawWidget(screen, canvas.getRegion());
    }
    for (ControlWidget overlay : overlays.values()) {
        canvas.drawWidget(overlay);
    }
    canvas.postRender();
}
Also used : ControlWidget(org.terasology.rendering.nui.ControlWidget) UIScreenLayer(org.terasology.rendering.nui.UIScreenLayer)

Aggregations

UIScreenLayer (org.terasology.rendering.nui.UIScreenLayer)6 ResourceUrn (org.terasology.assets.ResourceUrn)2 ControlWidget (org.terasology.rendering.nui.ControlWidget)2 ArrayList (java.util.ArrayList)1 LinkedList (java.util.LinkedList)1 InputSystem (org.terasology.input.InputSystem)1 UIElement (org.terasology.rendering.nui.asset.UIElement)1