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

x33g5p2x  于2022-01-16 转载在 其他  
字(2.8k)|赞(0)|评价(0)|浏览(101)

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

Actor.localToAscendantCoordinates介绍

[英]Converts coordinates for this actor to those of a parent actor. The ascendant does not need to be a direct parent.
[中]将此参与者的坐标转换为父参与者的坐标。上升者不需要是直接的父母。

代码示例

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

/** Transforms the specified point in the actor's coordinates to be in the stage's coordinates. */
public Vector2 localToStageCoordinates (Vector2 localCoords) {
  return localToAscendantCoordinates(null, localCoords);
}

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

/** Transforms the specified point in the actor's coordinates to be in the stage's coordinates. */
public Vector2 localToStageCoordinates (Vector2 localCoords) {
  return localToAscendantCoordinates(null, localCoords);
}

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

/** Transforms the specified point in the actor's coordinates to be in screen coordinates.
 * @see Stage#stageToScreenCoordinates(Vector2) */
public Vector2 localToScreenCoordinates (Vector2 localCoords) {
  Stage stage = this.stage;
  if (stage == null) return localCoords;
  return stage.stageToScreenCoordinates(localToAscendantCoordinates(null, localCoords));
}

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

/** Transforms the specified point in the actor's coordinates to be in screen coordinates.
 * @see Stage#stageToScreenCoordinates(Vector2) */
public Vector2 localToScreenCoordinates (Vector2 localCoords) {
  Stage stage = this.stage;
  if (stage == null) return localCoords;
  return stage.stageToScreenCoordinates(localToAscendantCoordinates(null, localCoords));
}

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

/** Transforms the specified point in the actor's coordinates to be in the stage's coordinates. */
public Vector2 localToStageCoordinates (Vector2 localCoords) {
  return localToAscendantCoordinates(null, localCoords);
}

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

/** Transforms the specified point in the actor's coordinates to be in screen coordinates.
 * @see Stage#stageToScreenCoordinates(Vector2) */
public Vector2 localToScreenCoordinates (Vector2 localCoords) {
  Stage stage = this.stage;
  if (stage == null) return localCoords;
  return stage.stageToScreenCoordinates(localToAscendantCoordinates(null, localCoords));
}

代码示例来源:origin: narfman0/GDXWorld

/** @param vec the coordinates
 *  @param actor the actor in which coordinate system vec is given
 *  @param other the actor into which coordinate system to convert the coordinates to
 *  @throws IllegalArgumentException if the given actors are not in the same hierarchy */
public static void localToOtherCoordinates(Vector2 vec, Actor actor, Actor other) {
  Group lastParent = lastParent(actor);
  if(lastParent == null || lastParent != lastParent(other))
    throw new IllegalArgumentException(actor + " and " + other + " are not in the same hierarchy");
  actor.localToAscendantCoordinates(lastParent, vec);
  lastParent.localToDescendantCoordinates(other, vec);
}

相关文章