com.badlogic.gdx.scenes.scene2d.Group.getX()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(3.6k)|赞(0)|评价(0)|浏览(155)

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

Group.getX介绍

暂无

代码示例

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

for (int i = 0; i < len; i++) {
  Group group = (Group)actors.get(i);
  renderer.point(group.getX() + group.getOriginX(), group.getY() + group.getOriginY(), 0);

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

protected Matrix4 computeTransform() {
    Affine2 worldTransform = this.worldTransform;
    Group root = getRoot();
    worldTransform.setToTrnRotScl(root.getX(), root.getY(), 0, root.getScaleX(), root.getScaleY());
    computedTransform.set(worldTransform);
    return computedTransform;
  }
}

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

@Override
public float[] getPositionAndSizeGui(String name) {
  IGui gui = GaiaSky.instance.mainGui;
  Actor actor = gui.getGuiStage().getRoot().findActor(name);
  if (actor != null) {
    float x = actor.getX();
    float y = actor.getY();
    // x and y relative to parent, so we need to add coordinates of
    // parents up to top
    Group parent = actor.getParent();
    while (parent != null) {
      x += parent.getX();
      y += parent.getY();
      parent = parent.getParent();
    }
    return new float[] { x, y, actor.getWidth(), actor.getHeight() };
  } else {
    return null;
  }
}

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

@Override
public void draw(Batch batch, float parentAlpha) {
  // TODO This is not the best way to apply the transformation, but, oh well
  float x = getParent().getX();
  float y = getParent().getY();
  // TODO For some strange reason, the texture coordinates and label coordinates are different
  Vector2 pos = localToStageCoordinates(new Vector2(x, y));
  batch.setColor(Klooni.theme.bandColor);
  batch.draw(bandTexture, pos.x, pos.y, getWidth(), getHeight());
  scoreLabel.setBounds(x + scoreBounds.x, y + scoreBounds.y, scoreBounds.width, scoreBounds.height);
  scoreLabel.setText(Integer.toString(scorer.getCurrentScore()));
  scoreLabel.setColor(Klooni.theme.textColor);
  scoreLabel.draw(batch, parentAlpha);
  infoLabel.setBounds(x + infoBounds.x, y + infoBounds.y, infoBounds.width, infoBounds.height);
  infoLabel.setColor(Klooni.theme.textColor);
  infoLabel.draw(batch, parentAlpha);
}

代码示例来源:origin: peakgames/libgdx-stagebuilder

@Override
public void draw(Batch batch, float parentAlpha) {
  batch.flush();
  clipBegin();
  super.draw(batch, parentAlpha);
  clipEnd();
  if (this.drawDebug) {
    batch.end();
    debugRenderer.setProjectionMatrix(batch.getProjectionMatrix());
    debugRenderer.begin(ShapeRenderer.ShapeType.Line);
    debugRenderer.rect(getX() + getParent().getX(), getY() + getParent().getY(), getWidth(), getHeight());
    debugRenderer.setColor(Color.YELLOW);
    debugRenderer.end();
    batch.begin();
  }
}

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

Group father=nativeTextField.getParent();
Group root=stage.getRoot();
float dx=root.getX()/root.getScaleX()-cutWidth;
float dy=root.getY()/root.getScaleY()-cutHeight;
fx+=dx;
while(father!=root){
  Group nextFather=father.getParent();
  fx+=father.getX();
  fy+=father.getY();
  father=nextFather;

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

Group root=stage.getRoot();
float dx=root.getX()/root.getScaleX()-cutWidth;//此处存有疑问,待测
float dy=root.getY()/root.getScaleY()-cutHeight;
fx+=dx;
while(father!=root){
  Group nextFather=father.getParent();
  fx+=father.getX();
  fy+=father.getY();
  father=nextFather;

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

Group father=nativeTextField.getParent();
Group root=stage.getRoot();
float dx=root.getX()-cutWidth;
float dy=root.getY()/root.getScaleY()-cutHeight;
while(father!=root){
  Group nextFather=father.getParent();
  fx+=father.getX();
  fy+=father.getY();
  father=nextFather;

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

Group father=nativeTextField.getParent();
Group root=stage.getRoot();
float dx=root.getX()-cutWidth;
float dy=root.getY()/root.getScaleY()-cutHeight;
while(father!=root){
  Group nextFather=father.getParent();
  fx+=father.getX();
  fy+=father.getY();
  father=nextFather;

相关文章

微信公众号

最新文章

更多