Пример #1
0
  protected Rect createDestRec(ActionFrameCounters actionFrameCounters) {
    int src_left = getInitSpriteXPos();
    int src_right = src_left + getWidth();

    int src_top = getInitSpriteYPos() + actionFrameCounters.getYOffset(faceDirection);

    int src_bottom = src_top + getHeight();
    return new Rect(src_left, src_top, src_right, src_bottom);
  }
Пример #2
0
  protected Rect createDestRecAnimatedHorizontally(
      ActionFrameCounters actionFrameCounters, int sprite_y_offset) {
    int src_left = getInitSpriteXPos() + actionFrameCounters.getXOffset();

    int src_right = src_left + getWidth();

    int src_top = sprite_y_offset;

    int src_bottom = src_top + getHeight();

    return new Rect(src_left, src_top, src_right, src_bottom);
  }