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

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

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

Table.getStage介绍

暂无

代码示例

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

  1. private void drawDebugRects (ShapeRenderer shapes) {
  2. if (debugRects == null || !getDebug()) return;
  3. shapes.set(ShapeType.Line);
  4. shapes.setColor(getStage().getDebugColor());
  5. float x = 0, y = 0;
  6. if (!isTransform()) {
  7. x = getX();
  8. y = getY();
  9. }
  10. for (int i = 0, n = debugRects.size; i < n; i++) {
  11. DebugRect debugRect = debugRects.get(i);
  12. shapes.setColor(debugRect.color);
  13. shapes.rect(x + debugRect.x, y + debugRect.y, debugRect.width, debugRect.height);
  14. }
  15. }

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

  1. private void drawDebugRects (ShapeRenderer shapes) {
  2. if (debugRects == null || !getDebug()) return;
  3. shapes.set(ShapeType.Line);
  4. shapes.setColor(getStage().getDebugColor());
  5. float x = 0, y = 0;
  6. if (!isTransform()) {
  7. x = getX();
  8. y = getY();
  9. }
  10. for (int i = 0, n = debugRects.size; i < n; i++) {
  11. DebugRect debugRect = debugRects.get(i);
  12. shapes.setColor(debugRect.color);
  13. shapes.rect(x + debugRect.x, y + debugRect.y, debugRect.width, debugRect.height);
  14. }
  15. }

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

  1. private void drawDebugRects (ShapeRenderer shapes) {
  2. if (debugRects == null || !getDebug()) return;
  3. shapes.set(ShapeType.Line);
  4. shapes.setColor(getStage().getDebugColor());
  5. float x = 0, y = 0;
  6. if (!isTransform()) {
  7. x = getX();
  8. y = getY();
  9. }
  10. for (int i = 0, n = debugRects.size; i < n; i++) {
  11. DebugRect debugRect = debugRects.get(i);
  12. shapes.setColor(debugRect.color);
  13. shapes.rect(x + debugRect.x, y + debugRect.y, debugRect.width, debugRect.height);
  14. }
  15. }

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

  1. /** Displays toast. Toast will be displayed for given amount of seconds. */
  2. public void show (final Toast toast, float timeSec) {
  3. Table toastMainTable = toast.getMainTable();
  4. if (toastMainTable.getStage() != null) {
  5. remove(toast);
  6. }
  7. toasts.add(toast);
  8. toast.setToastManager(this);
  9. toast.fadeIn();
  10. toastMainTable.pack();
  11. root.addActor(toastMainTable);
  12. updateToastsPositions();
  13. if (timeSec > 0) {
  14. Timer.Task fadeOutTask = new Timer.Task() {
  15. @Override
  16. public void run () {
  17. toast.fadeOut();
  18. timersTasks.remove(toast);
  19. }
  20. };
  21. timersTasks.put(toast, fadeOutTask);
  22. Timer.schedule(fadeOutTask, timeSec);
  23. }
  24. }

代码示例来源:origin: crashinvaders/gdx-texture-packer-gui

  1. /** Displays toast. Toast will be displayed for given amount of seconds. */
  2. public Toast show (final Toast toast, float timeSec) {
  3. Table toastMainTable = toast.getMainTable();
  4. if (toastMainTable.getStage() != null) {
  5. remove(toast);
  6. }
  7. toasts.add(toast);
  8. toast.setToastManager(this);
  9. toast.fadeIn();
  10. toastMainTable.pack();
  11. root.addActor(toastMainTable);
  12. updateToastsPositions();
  13. if (timeSec > 0) {
  14. Timer.Task fadeOutTask = new Timer.Task() {
  15. @Override
  16. public void run () {
  17. toast.fadeOut();
  18. timersTasks.remove(toast);
  19. }
  20. };
  21. timersTasks.put(toast, fadeOutTask);
  22. Timer.schedule(fadeOutTask, timeSec);
  23. }
  24. return toast;
  25. }

相关文章