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

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

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

Table.getColor介绍

暂无

代码示例

代码示例来源: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. /** 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. protected void drawBackground (Batch batch, float parentAlpha, float x, float y) {
  2. super.drawBackground(batch, parentAlpha, x, y);
  3. // Manually draw the title table before clipping is done.
  4. titleTable.getColor().a = getColor().a;
  5. float padTop = getPadTop(), padLeft = getPadLeft();
  6. titleTable.setSize(getWidth() - padLeft - getPadRight(), padTop);
  7. titleTable.setPosition(padLeft, getHeight() - padTop);
  8. drawTitleTable = true;
  9. titleTable.draw(batch, parentAlpha);
  10. drawTitleTable = false; // Avoid drawing the title table again in drawChildren.
  11. }

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

  1. protected void drawBackground (Batch batch, float parentAlpha, float x, float y) {
  2. super.drawBackground(batch, parentAlpha, x, y);
  3. // Manually draw the title table before clipping is done.
  4. titleTable.getColor().a = getColor().a;
  5. float padTop = getPadTop(), padLeft = getPadLeft();
  6. titleTable.setSize(getWidth() - padLeft - getPadRight(), padTop);
  7. titleTable.setPosition(padLeft, getHeight() - padTop);
  8. drawTitleTable = true;
  9. titleTable.draw(batch, parentAlpha);
  10. drawTitleTable = false; // Avoid drawing the title table again in drawChildren.
  11. }

代码示例来源: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.github.xaguzman/gamedevlib-libgdx

  1. protected void drawBackground (Batch batch, float parentAlpha, float x, float y) {
  2. super.drawBackground(batch, parentAlpha, x, y);
  3. // Manually draw the title table before clipping is done.
  4. titleTable.getColor().a = getColor().a;
  5. float padTop = getPadTop(), padLeft = getPadLeft();
  6. titleTable.setSize(getWidth() - padLeft - getPadRight(), padTop);
  7. titleTable.setPosition(padLeft, getHeight() - padTop);
  8. drawTitleTable = true;
  9. titleTable.draw(batch, parentAlpha);
  10. drawTitleTable = false; // Avoid drawing the title table again in drawChildren.
  11. }

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

  1. protected void drawBackground (Batch batch, float parentAlpha, float x, float y) {
  2. super.drawBackground(batch, parentAlpha, x, y);
  3. // Manually draw the title table before clipping is done.
  4. titleTable.getColor().a = getColor().a;
  5. float padTop = getPadTop(), padLeft = getPadLeft();
  6. titleTable.setSize(getWidth() - padLeft - getPadRight(), padTop);
  7. titleTable.setPosition(padLeft, getHeight() - padTop);
  8. drawTitleTable = true;
  9. titleTable.draw(batch, parentAlpha);
  10. drawTitleTable = false; // Avoid drawing the title table again in drawChildren.
  11. }

代码示例来源:origin: manuelbua/uracer-kotd

  1. @Override
  2. protected void drawBackground (Batch batch, float parentAlpha, float x, float y) {
  3. float width = getWidth(), height = getHeight();
  4. float padTop = getPadTop();
  5. super.drawBackground(batch, parentAlpha, x, y);
  6. // Draw button table.
  7. buttonTable.getColor().a = getColor().a;
  8. buttonTable.pack();
  9. buttonTable.setPosition(width - buttonTable.getWidth(), Math.min(height - padTop, height - buttonTable.getHeight()));
  10. buttonTable.draw(batch, parentAlpha);
  11. // Draw the title without the batch transformed or clipping applied.
  12. y += height;
  13. TextBounds bounds = titleCache.getBounds();
  14. if ((titleAlignment & Align.left) != 0)
  15. x += getPadLeft();
  16. else if ((titleAlignment & Align.right) != 0)
  17. x += width - bounds.width - getPadRight();
  18. else
  19. x += (width - bounds.width) / 2;
  20. if ((titleAlignment & Align.top) == 0) {
  21. if ((titleAlignment & Align.bottom) != 0)
  22. y -= padTop - bounds.height;
  23. else
  24. y -= (padTop - bounds.height) / 2;
  25. }
  26. titleCache.setColors(tmpColor.set(getColor()).mul(style.titleFontColor));
  27. titleCache.setPosition((int)x, (int)y - 15); // HACK for Kenney's skin only!!
  28. titleCache.draw(batch, parentAlpha);
  29. }

代码示例来源:origin: dsaltares/libgdx-cookbook

  1. table.getColor().a = 0f;

代码示例来源:origin: dsaltares/libgdx-cookbook

  1. table.getColor().a = 0f;

相关文章