Java Code Examples for org.andengine.entity.modifier.AlphaModifier#setAutoUnregisterWhenFinished()

The following examples show how to use org.andengine.entity.modifier.AlphaModifier#setAutoUnregisterWhenFinished() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AlphaMenuSceneAnimator.java    From tilt-game-android with MIT License 5 votes vote down vote up
@Override
protected void onMenuItemPositionBuilt(final MenuScene pMenuScene, final int pIndex, final IMenuItem pMenuItem, final float pX, final float pY) {
	pMenuItem.setPosition(pX, pY);

	final AlphaModifier alphaModifier = new AlphaModifier(AlphaMenuSceneAnimator.DURATION, AlphaMenuSceneAnimator.ALPHA_FROM, AlphaMenuSceneAnimator.ALPHA_TO, this.mEaseFunction);
	alphaModifier.setAutoUnregisterWhenFinished(false);
	pMenuItem.registerEntityModifier(alphaModifier);
}
 
Example 2
Source File: AlphaMenuAnimator.java    From 30-android-libraries-in-30-days with Apache License 2.0 5 votes vote down vote up
@Override
public void buildAnimations(final ArrayList<IMenuItem> pMenuItems, final float pCameraWidth, final float pCameraHeight) {
	final IEaseFunction easeFunction = this.mEaseFunction;
	final int menuItemCount = pMenuItems.size();
	for(int i = menuItemCount - 1; i >= 0; i--) {
		final AlphaModifier alphaModifier = new AlphaModifier(DURATION, ALPHA_FROM, ALPHA_TO, easeFunction);
		alphaModifier.setAutoUnregisterWhenFinished(false);
		pMenuItems.get(i).registerEntityModifier(alphaModifier);
	}
}