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

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

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

Table.draw介绍

[英]Called to draw the background, before clipping is applied (if enabled). Default implementation draws the background drawable.
[中]调用以在应用剪裁之前绘制背景(如果启用)。默认实现可绘制背景。

代码示例

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

public void draw (Batch batch, float parentAlpha) {
    if (drawTitleTable) super.draw(batch, parentAlpha);
  }
};

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

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

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

public void draw (Batch batch, float parentAlpha) {
    if (drawTitleTable) super.draw(batch, parentAlpha);
  }
};

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

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

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

public void draw (Batch batch, float parentAlpha) {
    super.draw(batch, parentAlpha);
  }
};

代码示例来源:origin: com.github.xaguzman/gamedevlib-libgdx

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

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

public void draw (Batch batch, float parentAlpha) {
  Stage stage = getStage();
  if (stage.getKeyboardFocus() == null) stage.setKeyboardFocus(this);
  keepWithinStage();
  if (style.stageBackground != null) {
    stageToLocalCoordinates(tmpPosition.set(0, 0));
    stageToLocalCoordinates(tmpSize.set(stage.getWidth(), stage.getHeight()));
    drawStageBackground(batch, parentAlpha, getX() + tmpPosition.x, getY() + tmpPosition.y, getX() + tmpSize.x,
      getY() + tmpSize.y);
  }
  super.draw(batch, parentAlpha);
}

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

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

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

public void draw (Batch batch, float parentAlpha) {
  Stage stage = getStage();
  if (stage.getKeyboardFocus() == null) stage.setKeyboardFocus(this);
  keepWithinStage();
  if (style.stageBackground != null) {
    stageToLocalCoordinates(tmpPosition.set(0, 0));
    stageToLocalCoordinates(tmpSize.set(stage.getWidth(), stage.getHeight()));
    drawStageBackground(batch, parentAlpha, getX() + tmpPosition.x, getY() + tmpPosition.y, getX() + tmpSize.x,
      getY() + tmpSize.y);
  }
  super.draw(batch, parentAlpha);
}

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

for (int i = 0; i < children.size; i++)
  children.get(i).moveBy(offsetX, offsetY);
super.draw(batch, parentAlpha);
for (int i = 0; i < children.size; i++)
  children.get(i).moveBy(-offsetX, -offsetY);

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

for (int i = 0; i < children.size; i++)
  children.get(i).moveBy(offsetX, offsetY);
super.draw(batch, parentAlpha);
for (int i = 0; i < children.size; i++)
  children.get(i).moveBy(-offsetX, -offsetY);

代码示例来源:origin: Var3D/var3dframe

@Override
public void draw(Batch batch, float parentAlpha)
{
  super.draw(batch, parentAlpha);
}
public void setActor(Actor actor)

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

public void draw (Batch batch, float parentAlpha) {
    if (drawTitleTable) super.draw(batch, parentAlpha);
  }
};

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

@Override
public void draw (Batch batch, float parentAlpha) {
  super.draw(batch, parentAlpha);
  if (style.border != null) style.border.draw(batch, getX(), getY(), getWidth(), getHeight());
}

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

@Override
public void draw(Batch batch, float parentAlpha) {
  super.draw(batch, parentAlpha);
  if (style.border != null)
    style.border.draw(batch, getX(), getY(), getWidth(), getHeight());
}

代码示例来源:origin: moribitotech/MTX

@Override
  public void draw(SpriteBatch batch, float parentAlpha) {
    // First draw bg
    if(textureBackground != null && isBackgroundTextureActive){
      batch.draw(textureBackground, getX(), getY(), getWidth(), getHeight());
    }
    
    // Then draw child actors over bg
    super.draw(batch, parentAlpha);
  }
}

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

@Override
public void draw(Batch batch, float parentAlpha) {
  super.draw(batch, parentAlpha);
  if (focused && focusBorderEnabled && style.focusBorder != null) {
    Color color = getColor();
    batch.setColor(color.r, color.g, color.b, color.a * parentAlpha);
    style.focusBorder.draw(batch, getX(), getY(), getWidth(), getHeight());
  }
}

代码示例来源:origin: moribitotech/MTX

@Override
  public void draw(SpriteBatch batch, float parentAlpha) {
    // Then draw child actors over bg
    super.draw(batch, parentAlpha);

    // First draw bg
    if (textureBackground != null && isBackgroundTextureActive) {
      batch.draw(textureBackground, getX(), getY(), getOriginX(),
          getOriginY(), getWidth(), getHeight(), getScaleX(),
          getScaleY(), getRotation());
    }
  }
}

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

public void draw (Batch batch, float parentAlpha) {
  Stage stage = getStage();
  if (stage.getKeyboardFocus() == null) stage.setKeyboardFocus(this);
  keepWithinStage();
  if (style.stageBackground != null) {
    stageToLocalCoordinates(tmpPosition.set(0, 0));
    stageToLocalCoordinates(tmpSize.set(stage.getWidth(), stage.getHeight()));
    drawStageBackground(batch, parentAlpha, getX() + tmpPosition.x, getY() + tmpPosition.y, getX() + tmpSize.x,
      getY() + tmpSize.y);
  }
  super.draw(batch, parentAlpha);
}

代码示例来源:origin: com.github.xaguzman/gamedevlib-libgdx

public void draw (Batch batch, float parentAlpha) {
  Stage stage = getStage();
  if (stage.getKeyboardFocus() == null) stage.setKeyboardFocus(this);
  keepWithinStage();
  if (style.stageBackground != null) {
    stageToLocalCoordinates(tmpPosition.set(0, 0));
    stageToLocalCoordinates(tmpSize.set(stage.getWidth(), stage.getHeight()));
    drawStageBackground(batch, parentAlpha, getX() + tmpPosition.x, getY() + tmpPosition.y, getX() + tmpSize.x, getY()
        + tmpSize.y);
  }
  super.draw(batch, parentAlpha);
}

相关文章

微信公众号

最新文章

更多