org.andengine.entity.modifier.AlphaModifier Java Examples

The following examples show how to use org.andengine.entity.modifier.AlphaModifier. 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);
	}
}
 
Example #3
Source File: ConfettiParticleSystem.java    From sopa with Apache License 2.0 5 votes vote down vote up
private static IEntityFactory<Rectangle> createEntityFactory(final VertexBufferObjectManager vbom) {

        return new IEntityFactory<Rectangle>() {
            @Override
            public Rectangle create(final float pX, final float pY) {

                Rectangle rectangle = new Rectangle(pX, pY, 30, 15, vbom);
                rectangle.setColor(COLOR_MAP[getRandomBetweenZeroAndThree()]);
                rectangle.registerEntityModifier(new RotationModifier(7f, (float) Math.random() * 360,
                        (7 - (float) Math.random() * 15) * 360));
                rectangle.registerEntityModifier(new AlphaModifier(4f, 0.7f, 0f));
                return rectangle;
            }};
    }
 
Example #4
Source File: FlashEntityModifier.java    From sopa with Apache License 2.0 4 votes vote down vote up
@Override
protected void onModifierFinished(IEntity pItem) {

    pEntity.registerEntityModifier(new AlphaModifier(0.1f, 1f, 0f));
}