私が達成しようとしているのは、ユーザーが設定内で変更したときの期間など、mRectanglesプロパティを変更することです。オリジナルのそれぞれの引数でmodifier.reset()を使用することになっていることを読みました。4番目のパラメーターで何を渡す必要があるのか理解できないようです。適切なコンテキストを取得するために呼び出す必要のある変数または関数はありますか?
@Override
public void onPopulateScene(Scene pScene,
OnPopulateSceneCallback pOnPopulateSceneCallback) throws Exception {
// TODO Auto-generated method stub
Rectangle mRectangle = new Rectangle(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT,
mEngine.getVertexBufferObjectManager());
// With this anonymous function, you can add events to the beginning and end
// of the modified state
IEntityModifierListener mIEntityModifierListener = new IEntityModifierListener() {
@Override
public void onModifierStarted(IModifier<IEntity> pModifier,
IEntity pItem) {
// Grab the current duration value and compare it to the
// one that's stored
final int mDuration = (int) pModifier.getDuration();
Log.i("MODIFIER", "Current duration value: " + mDuration);
if(mDuration != mDurationPref)
{
Log.i("UPDATEDURATION","Duration value: " + mDurationPref);
mFinalDuration = mDurationPref;
pModifier.reset();
}
else
{
Log.i("UPDATEDURATION","Both values match: " + COLORONE_DEFAULT);
mFinalDuration = COLORONE_DEFAULT;
}
}
@Override
public void onModifierFinished(IModifier<IEntity> pModifier,
IEntity pItem) {
// TODO Auto-generated method stub
Log.i("MODIFIER", "It finished!");
}
};
Log.i("FINALDURATIONVALUE", "Final duration: " + mFinalDuration);
// This is where you can chain up the colors
// TODO: Make this in to a function that interpolates the colors together
ColorModifier mColorModifier = new ColorModifier(5, Color.CYAN,
Color.RED, mIEntityModifierListener, EaseSineIn.getInstance());
ColorModifier tColorModifier = new ColorModifier(5, Color.RED,
Color.CYAN, EaseSineInOut.getInstance());
ColorModifier iColorModifier = new ColorModifier(5, Color.CYAN,
Color.GREEN, mIEntityModifierListener, EaseSineIn.getInstance());
ColorModifier xColorModifier = new ColorModifier(5, Color.GREEN,
Color.YELLOW, EaseSineInOut.getInstance());
ColorModifier yColorModifier = new ColorModifier(5, Color.YELLOW,
Color.CYAN, mIEntityModifierListener, EaseSineIn.getInstance());
// The sequence modifier will go through the color modifiers
// and the loop entity modifier makes it continuous
SequenceEntityModifier mSequenceEntityModifier = new SequenceEntityModifier(
mColorModifier, tColorModifier, iColorModifier, xColorModifier,
yColorModifier);
LoopEntityModifier mLoopEntityModifier = new LoopEntityModifier(
mSequenceEntityModifier);
mRectangle.registerEntityModifier(mLoopEntityModifier);
scene.attachChild(mRectangle);
pOnPopulateSceneCallback.onPopulateSceneFinished();
}