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

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

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

Table.getCells介绍

[英]Returns the cells for this table.
[中]返回此表的单元格。

代码示例

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

public List<Cell<? extends Actor>> cells(){
  List<Cell<? extends Actor>> list = new ArrayList<>();
  if(t instanceof Table)
    for(Cell<?> cell : ((Table)t).getCells())
      list.add(cell);
  return list;
}

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

public List<Cell<? extends Actor>> cells(){
  List<Cell<? extends Actor>> list = new ArrayList<>();
  if(get() instanceof Table)
    for(Cell<?> cell : ((Table)get()).getCells())
      list.add(cell);
  return list;
}

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

@Override
public void setWidth (float width) {
  super.setWidth(width);
  if (content != null) {
    for (Cell<?> cell : content.getCells()) {
      cell.width(width);
    }
    content.invalidate();
  }
}

代码示例来源:origin: langurmonkey/gaiasky

public void setSelectedIndex(int index) {
  if (selectedIndex == index)
    return;
  int tabs = tabTitleTable.getCells().size;
  if (selectedIndex >= 0 && selectedIndex < tabs) {
    setSelectedTab(false);
  }
  this.selectedIndex = index;
  if (selectedIndex >= 0 && selectedIndex < tabs) {
    setSelectedTab(true);
  }
  fireStateChanged();
}

代码示例来源: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: bladecoder/bladecoder-adventure-engine

public void setPageSpacing (float pageSpacing) {
  if (content != null) {
    content.defaults().space(pageSpacing);
    for (Cell<?> cell : content.getCells()) {
      cell.space(pageSpacing);
    }
    content.invalidate();
  }
}

代码示例来源:origin: langurmonkey/gaiasky

private void setSelectedTab(boolean value) {
  TabTitleButton tabTitleButton = ((TabTitleButton) tabTitleTable.getCells().get(selectedIndex).getActor());
  tabTitleButton.setDisabled(value); // Can't toggle the selected tab
  tabTitleButton.setChecked(value);
  tabBodyStack.getChildren().get(selectedIndex).setVisible(value);
}

代码示例来源: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: langurmonkey/gaiasky

public void addTab(String title, Actor actor) {
  int index = tabTitleTable.getCells().size;
  TabTitleButton button = new TabTitleButton(index, title, style);
  button.addListener(new ClickListener() {
    @Override
    public void clicked(InputEvent event, float x, float y) {
      TabTitleButton tabTitleButton = (TabTitleButton) event.getListenerActor();
      // if (tabTitleButton.isChecked())
      setSelectedIndex(tabTitleButton.index);
    }
  });
  tabTitleTable.add(button); // .uniform().fill(); // uniform gives tabs the same size
  tabBodyStack.add(actor);
  // Make sure the 1st tab is selected even after adding the tab
  // TODO
  // CAUTION: if you've added a ChangeListener before adding the tab
  // the following lines will fire 2 ChangeEvents.
  setSelectedIndex(index);
  setSelectedIndex(0);
}

代码示例来源:origin: langurmonkey/gaiasky

getTitleTable().getCells().get(0).padLeft(5 * GlobalConf.SCALE_FACTOR);

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

if (slots.getCells().size > 0)
  scroll.addPage(slots);

相关文章

微信公众号

最新文章

更多