com.badlogic.gdx.scenes.scene2d.ui.Table.getCell()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(112)

本文整理了Java中com.badlogic.gdx.scenes.scene2d.ui.Table.getCell()方法的一些代码示例,展示了Table.getCell()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.getCell()方法的具体详情如下:
包路径:com.badlogic.gdx.scenes.scene2d.ui.Table
类名称:Table
方法名:getCell

Table.getCell介绍

[英]Returns the cell for the specified actor in this table, or null.
[中]返回此表中指定参与者的单元格,或null。

代码示例

代码示例来源:origin: libgdx/libgdx

public boolean removeActor (Actor actor, boolean unfocus) {
  if (!super.removeActor(actor, unfocus)) return false;
  Cell cell = getCell(actor);
  if (cell != null) cell.actor = null;
  return true;
}

代码示例来源:origin: dingjibang/GDX-RPG

public Cell<?> cell(){
  try {
    if(t instanceof Table){
      return ((Table)t).getCells().get(0);
    }else{
      Actor parent = t.getParent();
      if(parent instanceof Table)
        return ((Table) parent).getCell(t);
    }
  } catch (Exception e) {
    return null;
  }
  return null;
}

代码示例来源:origin: libgdx/libgdx

public boolean removeActor (Actor actor, boolean unfocus) {
  if (!super.removeActor(actor, unfocus)) return false;
  Cell cell = getCell(actor);
  if (cell != null) cell.actor = null;
  return true;
}

代码示例来源:origin: dingjibang/GDX-RPG

public Cell<?> cell(){
  try {
    if(get() instanceof Table){
      return ((Table)get()).getCells().get(0);
    }else{
      Actor parent = get().getParent();
      if(parent instanceof Table)
        return ((Table) parent).getCell(get());
    }
  } catch (Exception e) {
    return null;
  }
  return null;
}

代码示例来源:origin: com.badlogicgames.gdx/gdx

public boolean removeActor (Actor actor, boolean unfocus) {
  if (!super.removeActor(actor, unfocus)) return false;
  Cell cell = getCell(actor);
  if (cell != null) cell.actor = null;
  return true;
}

代码示例来源:origin: stackoverflow.com

public static Cell parseInput(String input, Table target) {
 Cell cellToReturn = new Cell();
 ...
 if (input.references(cell)) cell = target.getCell(i,j); //No more error!
 ...
 return cellToReturn;
}

代码示例来源:origin: bladecoder/bladecoder-adventure-engine

public void setVisible(InputPanel i, boolean v) {
  i.setVisible(v);
  Cell<InputPanel> c = getCenterPanel().getCell(i);	
  
  if(v) {
    c.height(i.getPrefHeight());
  } else {
    c.height(1);
  }
  
  i.invalidateHierarchy();
}

代码示例来源:origin: bladecoder/bladecoder-adventure-engine

@Override
  public void clicked(InputEvent event, float x, float y) {
    if (System.currentTimeMillis() - time < 500) {
      count++;
    } else {
      count = 0;
    }
    time = System.currentTimeMillis();
    if (count == 4) {
      EngineLogger.toggle();
      if (ui.getWorld().isDisposed())
        return;
      if (EngineLogger.debugMode()) {
        iconStackTable.row();
        iconStackTable.add(debug);
      } else {
        Cell<?> cell = iconStackTable.getCell(debug);
        iconStackTable.removeActor(debug);
        cell.reset();
      }
    }
  }
});

代码示例来源:origin: kotcrab/vis-ui

/**
 * Adds close button to window, next to window title. After pressing that button, {@link #close()} is called. If nothing
 * else was added to title table, and current title alignment is center then the title will be automatically centered.
 */
public void addCloseButton () {
  Label titleLabel = getTitleLabel();
  Table titleTable = getTitleTable();
  VisImageButton closeButton = new VisImageButton("close-window");
  titleTable.add(closeButton).padRight(-getPadRight() + 0.7f);
  closeButton.addListener(new ChangeListener() {
    @Override
    public void changed (ChangeEvent event, Actor actor) {
      close();
    }
  });
  closeButton.addListener(new ClickListener() {
    @Override
    public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) {
      event.cancel();
      return true;
    }
  });
  if (titleLabel.getLabelAlign() == Align.center && titleTable.getChildren().size == 2)
    titleTable.getCell(titleLabel).padLeft(closeButton.getWidth() * 2);
}

相关文章

微信公众号

最新文章

更多