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

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

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

Table.layout介绍

[英]Positions and sizes children of the table using the cell associated with each child. The values given are the position within the parent and size of the table.
[中]使用与每个子项关联的单元格来定位和调整表的子项。给出的值是父对象中的位置和表的大小。

代码示例

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

  1. float height = getHeight();
  2. layout(0, 0, width, height);

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

  1. float height = getHeight();
  2. layout(0, 0, width, height);

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

  1. t.add(myLabel);
  2. t.layout();

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

  1. float height = getHeight();
  2. layout(0, 0, width, height);

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

  1. public void send(Console.ConsoleLog log){
  2. if(log.text == null)
  3. return;
  4. cursor = history.size();
  5. String command = "";
  6. if(log.from != null){
  7. command = "[#aaaaaaff][[" + log.time + "][] [#" + log.from.color() + "]<" + log.from.name() + ">[]";
  8. }
  9. if(log.color != null){
  10. command += "[#" + log.color + "]" + log.text.replaceAll("\\[", "[[") + "[]";
  11. }else{
  12. command += log.text;
  13. }
  14. Label label = new Label(command, 18).maxWidth(Game.width() - 10).warp(true).markup(true).left();
  15. out.add(label).left().width(Game.width() - 10).pad(4, 5, 4, 5).row();
  16. out.layout();
  17. pane.layout();
  18. pane.setScrollPercentY(100);
  19. }

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

  1. /**
  2. * Sets chooser selected files. Compared to {@link #setSelectedFiles(FileHandle...)} does not remove invalid files
  3. * from selection.
  4. */
  5. public void highlightFiles (FileHandle... files) {
  6. for (FileHandle file : files) {
  7. FileItem item = fileListAdapter.getViews().get(file);
  8. if (item != null) {
  9. item.select(false);
  10. }
  11. }
  12. if (files.length > 0) {
  13. FileItem item = fileListAdapter.getViews().get(files[0]);
  14. if (item != null) {
  15. if (item.getParent() instanceof Table) { //table at this point may need additional layout to calculate proper target scroll cords
  16. ((Table) item.getParent()).layout();
  17. }
  18. item.localToParentCoordinates(tmpVector.setZero());
  19. fileListView.getScrollPane().scrollTo(tmpVector.x, tmpVector.y, item.getWidth(), item.getHeight(), false, true);
  20. }
  21. }
  22. updateSelectedFileFieldText();
  23. }

代码示例来源:origin: LonamiWebs/Klooni1010

  1. private void loadShop() {
  2. showcaseIndex = 0; // Reset the index
  3. final GameLayout layout = new GameLayout();
  4. shopGroup.clear();
  5. if (showingEffectsShop)
  6. for (IEffectFactory effect : Klooni.EFFECTS)
  7. addCard(new EffectCard(game, layout, effect));
  8. else // showingThemesShop
  9. for (Theme theme : Theme.getThemes())
  10. addCard(new ThemeCard(game, layout, theme));
  11. // Scroll to the currently selected item
  12. table.layout();
  13. for (Actor a : shopGroup.getChildren()) {
  14. ShopCard c = (ShopCard) a;
  15. if (c.isUsed()) {
  16. shopScroll.scrollTo(
  17. c.getX(), c.getY() + c.getHeight(),
  18. c.getWidth(), c.getHeight());
  19. break;
  20. }
  21. c.usedItemUpdated();
  22. }
  23. }

相关文章