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

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

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

Actor.getScaleY介绍

暂无

代码示例

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

protected void begin () {
  startX = target.getScaleX();
  startY = target.getScaleY();
}

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

protected void begin () {
  startX = target.getScaleX();
  startY = target.getScaleY();
}

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

protected void begin () {
  startX = target.getScaleX();
  startY = target.getScaleY();
}

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

private static float getScaledHeight(Actor actor) {
  return actor.getHeight() * actor.getScaleY();
}

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

/**
 * Scale effect and Back to previous scale (SC, BTN)
 * */
public static void create_SC_BTN(Actor actor, float scaleRatioX,
    float scaleRatioY, float duration, final Group group,
    final boolean removeActor) {
  if (actor != null) {
    float originalScaleX = actor.getScaleX();
    float originalScaleY = actor.getScaleY();
    actor.addAction(Actions.sequence(
        Actions.scaleTo(scaleRatioX, scaleRatioY, duration),
        Actions.scaleTo(originalScaleX, originalScaleY, duration),
        new Action() {
          @Override
          public boolean act(float delta) {
            if (removeActor) {
              removeActor(group, actor);
              return false;
            } else {
              return true;
            }
          }
        }));
  }
}

代码示例来源:origin: xietansheng/FlappyBirdForGDX

actor1.getHeight() * actor1.getScaleY()
);
rect1.setPosition(
    actor1.getX() - (actor1.getOriginX() * actor1.getScaleX() - actor1.getOriginX()),
    actor1.getY() - (actor1.getOriginY() * actor1.getScaleY() - actor1.getOriginY())
);
    actor2.getHeight() * actor2.getScaleY()
);
rect2.setPosition(
    actor2.getX() - (actor2.getOriginX() * actor2.getScaleX() - actor2.getOriginX()),
    actor2.getY() - (actor2.getOriginY() * actor2.getScaleY() - actor2.getOriginY())
);

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

@Override
public int getValues(Actor target, int tweenType, float[] returnValues)
{
  switch (tweenType)
  {
  case POS_XY:
    returnValues[0] = target.getX();
    returnValues[1] = target.getY();
    return 2;
  case CPOS_XY:
    returnValues[0] = target.getX() + target.getWidth()*.5f;
    returnValues[1] = target.getY() + target.getHeight()*.5f;
    return 2;
  case SCALE_XY:
    returnValues[0] = target.getScaleX();
    returnValues[1] = target.getScaleY();
    return 2;
  case ROTATION: returnValues[0] = target.getRotation(); return 1;
  case OPACITY: returnValues[0] = target.getColor().a; return 1;
  case TINT:
    returnValues[0] = target.getColor().r;
    returnValues[1] = target.getColor().g;
    returnValues[2] = target.getColor().b;
    return 3;
  default: assert false; return -1;
  }
}

相关文章