示例#1
0
  private void drawRect(Actor actor, DebugRect debugRect) {
    topLeft.set(debugRect.bottomLeft.x, debugRect.topRight.y);
    topRight.set(debugRect.topRight.x, debugRect.topRight.y);
    bottomRight.set(debugRect.topRight.x, debugRect.bottomLeft.y);
    bottomLeft.set(debugRect.bottomLeft.x, debugRect.bottomLeft.y);

    // Transform to stage coordinates using the scale, rotation and translation of the entire
    // ancestor hierarchy.
    actor.localToStageCoordinates(topLeft);
    actor.localToStageCoordinates(topRight);
    actor.localToStageCoordinates(bottomRight);
    actor.localToStageCoordinates(bottomLeft);

    shapes.setColor(debugRect.color);
    shapes.line(topLeft, topRight);
    shapes.line(topRight, bottomRight);
    shapes.line(bottomRight, bottomLeft);
    shapes.line(bottomLeft, topLeft);
  }