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

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

Introduction

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

Prototype

public Table debugCell() 

Source Link

Document

Turns on cell 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"));
    }/*from  www  .  j ava  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;
}