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

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

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

Table.getHeight介绍

暂无

代码示例

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

  1. public Actor hit (float x, float y, boolean touchable) {
  2. if (clip) {
  3. if (touchable && getTouchable() == Touchable.disabled) return null;
  4. if (x < 0 || x >= getWidth() || y < 0 || y >= getHeight()) return null;
  5. }
  6. return super.hit(x, y, touchable);
  7. }

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

  1. public Actor hit (float x, float y, boolean touchable) {
  2. if (clip) {
  3. if (touchable && getTouchable() == Touchable.disabled) return null;
  4. if (x < 0 || x >= getWidth() || y < 0 || y >= getHeight()) return null;
  5. }
  6. return super.hit(x, y, touchable);
  7. }

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

  1. private void addDebugRect (float x, float y, float w, float h, Color color) {
  2. if (debugRects == null) debugRects = new Array();
  3. DebugRect rect = DebugRect.pool.obtain();
  4. rect.color = color;
  5. rect.set(x, getHeight() - y - h, w, h);
  6. debugRects.add(rect);
  7. }

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

  1. /** Called to draw the background, before clipping is applied (if enabled). Default implementation draws the background
  2. * drawable. */
  3. protected void drawBackground (Batch batch, float parentAlpha, float x, float y) {
  4. if (background == null) return;
  5. Color color = getColor();
  6. batch.setColor(color.r, color.g, color.b, color.a * parentAlpha);
  7. background.draw(batch, x, y, getWidth(), getHeight());
  8. }

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

  1. private void addDebugRect (float x, float y, float w, float h, Color color) {
  2. if (debugRects == null) debugRects = new Array();
  3. DebugRect rect = DebugRect.pool.obtain();
  4. rect.color = color;
  5. rect.set(x, getHeight() - y - h, w, h);
  6. debugRects.add(rect);
  7. }

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

  1. /** Called to draw the background, before clipping is applied (if enabled). Default implementation draws the background
  2. * drawable. */
  3. protected void drawBackground (Batch batch, float parentAlpha, float x, float y) {
  4. if (background == null) return;
  5. Color color = getColor();
  6. batch.setColor(color.r, color.g, color.b, color.a * parentAlpha);
  7. background.draw(batch, x, y, getWidth(), getHeight());
  8. }

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

  1. public void layout () {
  2. float width = getWidth();
  3. float height = getHeight();

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

  1. public void layout () {
  2. float width = getWidth();
  3. float height = getHeight();

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

  1. public void drawDebug (ShapeRenderer shapes) {
  2. if (isTransform()) {
  3. applyTransform(shapes, computeTransform());
  4. drawDebugRects(shapes);
  5. if (clip) {
  6. shapes.flush();
  7. float x = 0, y = 0, width = getWidth(), height = getHeight();
  8. if (background != null) {
  9. x = padLeft.get(this);
  10. y = padBottom.get(this);
  11. width -= x + padRight.get(this);
  12. height -= y + padTop.get(this);
  13. }
  14. if (clipBegin(x, y, width, height)) {
  15. drawDebugChildren(shapes);
  16. clipEnd();
  17. }
  18. } else
  19. drawDebugChildren(shapes);
  20. resetTransform(shapes);
  21. } else {
  22. drawDebugRects(shapes);
  23. super.drawDebug(shapes);
  24. }
  25. }

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

  1. public void drawDebug (ShapeRenderer shapes) {
  2. if (isTransform()) {
  3. applyTransform(shapes, computeTransform());
  4. drawDebugRects(shapes);
  5. if (clip) {
  6. shapes.flush();
  7. float x = 0, y = 0, width = getWidth(), height = getHeight();
  8. if (background != null) {
  9. x = padLeft.get(this);
  10. y = padBottom.get(this);
  11. width -= x + padRight.get(this);
  12. height -= y + padTop.get(this);
  13. }
  14. if (clipBegin(x, y, width, height)) {
  15. drawDebugChildren(shapes);
  16. clipEnd();
  17. }
  18. } else
  19. drawDebugChildren(shapes);
  20. resetTransform(shapes);
  21. } else {
  22. drawDebugRects(shapes);
  23. super.drawDebug(shapes);
  24. }
  25. }

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

  1. public void draw (Batch batch, float parentAlpha) {
  2. validate();
  3. if (isTransform()) {
  4. applyTransform(batch, computeTransform());
  5. drawBackground(batch, parentAlpha, 0, 0);
  6. if (clip) {
  7. batch.flush();
  8. float padLeft = this.padLeft.get(this), padBottom = this.padBottom.get(this);
  9. if (clipBegin(padLeft, padBottom, getWidth() - padLeft - padRight.get(this),
  10. getHeight() - padBottom - padTop.get(this))) {
  11. drawChildren(batch, parentAlpha);
  12. batch.flush();
  13. clipEnd();
  14. }
  15. } else
  16. drawChildren(batch, parentAlpha);
  17. resetTransform(batch);
  18. } else {
  19. drawBackground(batch, parentAlpha, getX(), getY());
  20. super.draw(batch, parentAlpha);
  21. }
  22. }

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

  1. public void draw (Batch batch, float parentAlpha) {
  2. validate();
  3. if (isTransform()) {
  4. applyTransform(batch, computeTransform());
  5. drawBackground(batch, parentAlpha, 0, 0);
  6. if (clip) {
  7. batch.flush();
  8. float padLeft = this.padLeft.get(this), padBottom = this.padBottom.get(this);
  9. if (clipBegin(padLeft, padBottom, getWidth() - padLeft - padRight.get(this),
  10. getHeight() - padBottom - padTop.get(this))) {
  11. drawChildren(batch, parentAlpha);
  12. batch.flush();
  13. clipEnd();
  14. }
  15. } else
  16. drawChildren(batch, parentAlpha);
  17. resetTransform(batch);
  18. } else {
  19. drawBackground(batch, parentAlpha, getX(), getY());
  20. super.draw(batch, parentAlpha);
  21. }
  22. }

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

  1. topLeft.setSize(contWidth, contHeight);
  2. x = bottomLeft.getX();
  3. y = bottomLeft.getY() + bottomLeft.getHeight() + gap;
  4. topLeft.setPosition(x, y);
  5. stage.addActor(topLeft);
  6. horizOnlyTop.setSize(contWidth, contHeight);
  7. x = topRight.getX();
  8. y = topRight.getY() + topRight.getHeight() + gap;
  9. horizOnlyTop.setPosition(x, y);
  10. stage.addActor(horizOnlyTop);
  11. horizOnlyBottom.setSize(contWidth, contHeight);
  12. x = topLeft.getX();
  13. y = topLeft.getY() + topLeft.getHeight() + gap;
  14. horizOnlyBottom.setPosition(x, y);
  15. stage.addActor(horizOnlyBottom);
  16. vertOnlyLeft.setSize(contWidth, contHeight);
  17. x = horizOnlyBottom.getX();
  18. y = horizOnlyBottom.getY() + horizOnlyBottom.getHeight() + gap;
  19. vertOnlyLeft.setPosition(x, y);
  20. stage.addActor(vertOnlyLeft);
  21. vertOnlyRight.setSize(contWidth, contHeight);
  22. x = horizOnlyTop.getX();
  23. y = horizOnlyTop.getY() + horizOnlyTop.getHeight() + gap;
  24. vertOnlyRight.setPosition(x, y);
  25. stage.addActor(vertOnlyRight);

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

  1. private void updateToastsPositions () {
  2. boolean bottom = (alignment & Align.bottom) != 0;
  3. boolean left = (alignment & Align.left) != 0;
  4. float y = bottom ? screenPaddingY : root.getHeight() - screenPaddingY;
  5. for (Toast toast : toasts) {
  6. Table table = toast.getMainTable();
  7. table.setPosition(
  8. left ? screenPaddingX : root.getWidth() - table.getWidth() - screenPaddingX,
  9. bottom ? y : y - table.getHeight());
  10. y += (table.getHeight() + messagePadding) * (bottom ? 1 : -1);
  11. }
  12. }

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

  1. private void updateToastsPositions () {
  2. boolean bottom = (alignment & Align.bottom) != 0;
  3. boolean left = (alignment & Align.left) != 0;
  4. float y = bottom ? screenPadding : root.getHeight() - screenPadding;
  5. for (Toast toast : toasts) {
  6. Table table = toast.getMainTable();
  7. table.setPosition(
  8. left ? screenPadding : root.getWidth() - table.getWidth() - screenPadding,
  9. bottom ? y : y - table.getHeight());
  10. y += (table.getHeight() + messagePadding) * (bottom ? 1 : -1);
  11. }
  12. }

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

  1. public Actor hit (float x, float y, boolean touchable) {
  2. if (clip) {
  3. if (touchable && getTouchable() == Touchable.disabled) return null;
  4. if (x < 0 || x >= getWidth() || y < 0 || y >= getHeight()) return null;
  5. }
  6. return super.hit(x, y, touchable);
  7. }

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

  1. /** Called to draw the background, before clipping is applied (if enabled). Default implementation draws the background
  2. * drawable. */
  3. protected void drawBackground (Batch batch, float parentAlpha, float x, float y) {
  4. if (background == null) return;
  5. Color color = getColor();
  6. batch.setColor(color.r, color.g, color.b, color.a * parentAlpha);
  7. background.draw(batch, x, y, getWidth(), getHeight());
  8. }

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

  1. private void addDebugRect (float x, float y, float w, float h, Color color) {
  2. if (debugRects == null) debugRects = new Array();
  3. DebugRect rect = DebugRect.pool.obtain();
  4. rect.color = color;
  5. rect.set(x, getHeight() - y - h, w, h);
  6. debugRects.add(rect);
  7. }

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

  1. public void ko(String error) {
  2. // Error
  3. Gdx.app.postRunnable(() -> {
  4. String msg = error;
  5. table.add(new OwnLabel(msg, skin, "ui-15"));
  6. table.pack();
  7. scroll.setHeight(table.getHeight() + pad);
  8. finish();
  9. });
  10. }

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

  1. public void notFound() {
  2. // Not found
  3. String msg = I18n.bundle.format("error.gaiacatalog.notfound", st.getName());
  4. table.add(new OwnLabel(msg, skin, "ui-15"));
  5. table.pack();
  6. scroll.setHeight(table.getHeight() + pad);
  7. finish();
  8. }

相关文章