コード例 #1
0
ファイル: Scene.java プロジェクト: AtkinsSJ/beardsim
  public Scene(BeardSim game) {
    super(Gdx.graphics.getWidth(), Gdx.graphics.getHeight(), false);
    this.game = game;

    this.inputs = new InputMultiplexer(this);
    this.inputs.addProcessor(new GestureDetector(this));

    this.table = new Table(game.getSkin());
    this.table.setFillParent(true);
  }
コード例 #2
0
ファイル: Scene.java プロジェクト: AtkinsSJ/beardsim
  /**
   * Recursively refresh the skin for each Widget
   *
   * @param group
   */
  public void reskin(WidgetGroup group) {
    Skin skin = game.getSkin();
    SnapshotArray<Actor> children = group.getChildren();

    /**
     * This code is horrendously ugly. I'm so sorry. :( However, I can't think of a better way to do
     * it.
     */
    Actor actor;
    for (int i = 0; i < children.size; i++) {
      actor = children.get(i);
      if (actor instanceof UIWidget) {
        // UIWidgets are the best! :D
        ((UIWidget) actor).reskin(skin);
      }

      if (actor instanceof WidgetGroup) {
        // If it's a group, recurse
        reskin((WidgetGroup) actor);
      }
    }

    group.validate();
  }