私は解決策を見つけました、そしてそれは非常に簡単です。を継承し、MoveModifier class
更新メソッドをオーバーライドする新しい修飾子を作成しました。
public class LineMoveModifier extends MoveModifier{
public LineMoveModifier(float pDuration, float pFromX, float pToX,
float pFromY, float pToY) {
super(pDuration, pFromX, pToX, pFromY, pToY);
// TODO Auto-generated constructor stub
}
public LineMoveModifier(final float pDuration, final float pFromX, final float pToX, final float pFromY, final float pToY, final IEntityModifierListener pEntityModifierListener, final IEaseFunction pEaseFunction) {
super(pDuration, pFromX, pToX, pFromY, pToY, pEntityModifierListener, pEaseFunction);
}
@Override
protected void onSetValues(final IEntity pEntity, final float pPercentageDone, final float pX, final float pY) {
Line x = (Line)pEntity;
x.setPosition(x.getX1(), x.getY1(), pX, pY);
}
}
たとえば、これを使用する場合:
x = new Line(0, 0, 5, 5, 5, getVertexBufferObjectManager(), DrawType.DYNAMIC);
LineMoveModifier lmm = new LineMoveModifier(5, 5, 400, 5, 700);
mainScene.attachChild(x);
それが役に立てば幸い :)