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

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

本文整理了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

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

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

  1. public Cell<?> cell(){
  2. try {
  3. if(t instanceof Table){
  4. return ((Table)t).getCells().get(0);
  5. }else{
  6. Actor parent = t.getParent();
  7. if(parent instanceof Table)
  8. return ((Table) parent).getCell(t);
  9. }
  10. } catch (Exception e) {
  11. return null;
  12. }
  13. return null;
  14. }

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

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

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

  1. public Cell<?> cell(){
  2. try {
  3. if(get() instanceof Table){
  4. return ((Table)get()).getCells().get(0);
  5. }else{
  6. Actor parent = get().getParent();
  7. if(parent instanceof Table)
  8. return ((Table) parent).getCell(get());
  9. }
  10. } catch (Exception e) {
  11. return null;
  12. }
  13. return null;
  14. }

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

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

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

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

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

  1. public void setVisible(InputPanel i, boolean v) {
  2. i.setVisible(v);
  3. Cell<InputPanel> c = getCenterPanel().getCell(i);
  4. if(v) {
  5. c.height(i.getPrefHeight());
  6. } else {
  7. c.height(1);
  8. }
  9. i.invalidateHierarchy();
  10. }

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

  1. @Override
  2. public void clicked(InputEvent event, float x, float y) {
  3. if (System.currentTimeMillis() - time < 500) {
  4. count++;
  5. } else {
  6. count = 0;
  7. }
  8. time = System.currentTimeMillis();
  9. if (count == 4) {
  10. EngineLogger.toggle();
  11. if (ui.getWorld().isDisposed())
  12. return;
  13. if (EngineLogger.debugMode()) {
  14. iconStackTable.row();
  15. iconStackTable.add(debug);
  16. } else {
  17. Cell<?> cell = iconStackTable.getCell(debug);
  18. iconStackTable.removeActor(debug);
  19. cell.reset();
  20. }
  21. }
  22. }
  23. });

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

  1. /**
  2. * Adds close button to window, next to window title. After pressing that button, {@link #close()} is called. If nothing
  3. * else was added to title table, and current title alignment is center then the title will be automatically centered.
  4. */
  5. public void addCloseButton () {
  6. Label titleLabel = getTitleLabel();
  7. Table titleTable = getTitleTable();
  8. VisImageButton closeButton = new VisImageButton("close-window");
  9. titleTable.add(closeButton).padRight(-getPadRight() + 0.7f);
  10. closeButton.addListener(new ChangeListener() {
  11. @Override
  12. public void changed (ChangeEvent event, Actor actor) {
  13. close();
  14. }
  15. });
  16. closeButton.addListener(new ClickListener() {
  17. @Override
  18. public boolean touchDown (InputEvent event, float x, float y, int pointer, int button) {
  19. event.cancel();
  20. return true;
  21. }
  22. });
  23. if (titleLabel.getLabelAlign() == Align.center && titleTable.getChildren().size == 2)
  24. titleTable.getCell(titleLabel).padLeft(closeButton.getWidth() * 2);
  25. }

相关文章