public Object clone() { PipAnimateFrame ret = new PipAnimateFrame(parent); ret.name = name; for (int i = 0; i < pieces.size(); i++) { PipAnimateFramePiece piece = (PipAnimateFramePiece) pieces.get(i).clone(); piece.setParent(ret); ret.pieces.add(piece); } return ret; }
// 拟合绘制过渡帧 public void drawTransform( GLGraphics g, int x, int y, double ratio, ImageDrawCache cache, PipAnimateFrame nextFrame, double percent, int rotate, int scalex, int scaley, int color) { if (parent.drawFrameListener != null) { if (!parent.drawFrameListener.beforeDrawFrame(parent, this, g, x, y, ratio)) { return; } } int count = pieces.size(); for (int i = 0; i < count; i++) { PipAnimateFramePiece piece = pieces.get(i); if (!piece.visible) { continue; } PipAnimateFramePiece nextPiece = null; if (nextFrame != null) { for (int j = 0; j < nextFrame.getPieceCount(); j++) { PipAnimateFramePiece np = nextFrame.getPiece(j); if (np.getImageID() == piece.getImageID() && np.getFrame() == piece.getFrame() && np.getTransition() == piece.getTransition()) { nextPiece = np; break; } } } piece.drawTransform(g, x, y, ratio, cache, nextPiece, percent, rotate, scalex, scaley, color); } if (parent.drawFrameListener != null) { parent.drawFrameListener.afterDrawFrame(parent, this, g, x, y, ratio); } }