Example usage for com.badlogic.gdx.scenes.scene2d.ui Table debugTable

List of usage examples for com.badlogic.gdx.scenes.scene2d.ui Table debugTable

Introduction

In this page you can find the example usage for com.badlogic.gdx.scenes.scene2d.ui Table debugTable.

Prototype

public Table debugTable() 

Source Link

Document

Turns on table debug lines.

Usage

From source file:at.highstreeto.xnllayoutparser.element.TableParser.java

License:Apache License

@Override
public Actor load(Element element, LayoutParserContext context) throws LayoutParseException {
    Table table = new Table();

    if (element.getAttributes().containsKey("fillParent")) {
        table.setFillParent(element.getBooleanAttribute("fillParent"));
    }/*w  w w .  jav a 2 s. c  o  m*/
    if (element.getAttributes().containsKey("debug")) {
        String[] parts = element.getAttribute("debug").split(" ");
        for (String i : parts) {
            if ("cell".equals(i)) {
                table.debugCell();
            } else if ("table".equals(i)) {
                table.debugTable();
            }
        }
    }
    // Combination of c (Center), t (Top), b (Bottom), l (Left), r (Right)
    if (element.getAttributes().containsKey("align")) {
        String[] parts = element.getAttribute("align").split(" ");
        for (String i : parts) {
            if ("c".equals(i)) {
                table.center();
            } else if ("t".equals(i)) {
                table.top();
            } else if ("b".equals(i)) {
                table.bottom();
            } else if ("l".equals(i)) {
                table.left();
            } else if ("r".equals(i)) {
                table.right();
            }
        }
    }

    context.addActor(table, element);
    ElementParserHelper.setActorName(element, table);

    for (int i = 0; i < element.getChildCount(); i++) {
        Element child = element.getChild(i);
        context.getParsers().getParserByElementName(child).load(child, context);
    }
    return table;
}