本文整理汇总了Java中org.andengine.entity.modifier.AlphaModifier类的典型用法代码示例。如果您正苦于以下问题:Java AlphaModifier类的具体用法?Java AlphaModifier怎么用?Java AlphaModifier使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AlphaModifier类属于org.andengine.entity.modifier包,在下文中一共展示了AlphaModifier类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createCursorSprite
import org.andengine.entity.modifier.AlphaModifier; //导入依赖的package包/类
/**
* カーソル描画.
* @param mapPoint
*/
private Sprite createCursorSprite(Point mapIndexPoint, Color color) {
PointF pointF = MapGridUtil.indexToDisp(new Point(mapIndexPoint.x, mapIndexPoint.y));
Sprite cursor = getBaseScene().getResourceSprite("grid128.png");
cursor.setColor(color);
cursor.setSize(MapGridUtil.GRID_X, MapGridUtil.GRID_Y);
cursor.setPosition(pointF.x, pointF.y);
cursor.registerEntityModifier(new LoopEntityModifier(new SequenceEntityModifier(
new AlphaModifier(0.5f, 0.2f, 0.6f),
new AlphaModifier(0.5f, 0.6f, 0.2f)
)));
getBaseMap().attachChild(cursor);
return cursor;
}
示例2: hideDices
import org.andengine.entity.modifier.AlphaModifier; //导入依赖的package包/类
public void hideDices(){
for(DiceSprite diceSprite :diceSprites){
if(!diceSprite.isReadyToRoll()){
if(diceSprite.getAlpha()!=0f) {
diceSprite.registerEntityModifier(new AlphaModifier(Constants.ANIMATION_DURATION, 1f, 0f));
}
}
}
}
示例3: showDices
import org.andengine.entity.modifier.AlphaModifier; //导入依赖的package包/类
public void showDices(){
for(DiceSprite diceSprite :diceSprites){
if(!diceSprite.isReadyToRoll()){
diceSprite.registerEntityModifier(new AlphaModifier(Constants.ANIMATION_DURATION,0f,1f));
}
}
}
示例4: onMenuItemPositionBuilt
import org.andengine.entity.modifier.AlphaModifier; //导入依赖的package包/类
@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);
}
示例5: buildAnimations
import org.andengine.entity.modifier.AlphaModifier; //导入依赖的package包/类
@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);
}
}
示例6: createEntityFactory
import org.andengine.entity.modifier.AlphaModifier; //导入依赖的package包/类
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;
}};
}
示例7: show
import org.andengine.entity.modifier.AlphaModifier; //导入依赖的package包/类
public void show(){
if(this.getAlpha()!=1f) {
this.registerEntityModifier(new AlphaModifier(Constants.ANIMATION_DICE, 0f, 1f));
}
}
示例8: hide
import org.andengine.entity.modifier.AlphaModifier; //导入依赖的package包/类
public void hide(){
if(this.getAlpha()!=0f) {
this.registerEntityModifier(new AlphaModifier(Constants.ANIMATION_DICE, 1f, 0f));
}
}
示例9: onModifierFinished
import org.andengine.entity.modifier.AlphaModifier; //导入依赖的package包/类
@Override
protected void onModifierFinished(IEntity pItem) {
pEntity.registerEntityModifier(new AlphaModifier(0.1f, 1f, 0f));
}
示例10: onShowScene
import org.andengine.entity.modifier.AlphaModifier; //导入依赖的package包/类
@SuppressWarnings("static-access")
@Override
public void onShowScene() {
SFXManager.playSound(ResourceManager.getInstance().menuLogoMadgear);
sprLogoMadGear = new Sprite(SCREEN_WIDTH/2, SCREEN_HEIGHT/2,
ResourceManager.getInstance().splashLogo.getWidth(),
ResourceManager.getInstance().splashLogo.getHeight(),
ResourceManager.getInstance().splashLogo,
ResourceManager.getInstance().engine.getVertexBufferObjectManager());
sprLogoMadGear.setAlpha(0f);
attachChild(sprLogoMadGear);
mSeqEntMod= new SequenceEntityModifier(
new DelayModifier(timePreLogo),// Logo still not visible
new ParallelEntityModifier(// Logo enters
new AlphaModifier(timeLogoIn, 0, 1),
new ScaleModifier(timeLogoIn, 0.95f, 1)
),
new DelayModifier(timeLogoStay), // Logo stays
new ParallelEntityModifier(// Logo exits
new AlphaModifier(timeLogoOut, 1, 0),
new ScaleModifier(timeLogoOut, 1, 0.95f)
),
new DelayModifier(timePostLogo) // Logo not visible again
);
sprLogoMadGear.registerEntityModifier(mSeqEntMod);
startTime = ResourceManager.getInstance().engine.getSecondsElapsedTotal();
updateHandler = new IUpdateHandler() {
@Override
public void onUpdate(float pSecondsElapsed) {
if (ResourceManager.getInstance().engine.getSecondsElapsedTotal()>startTime+exitDelay) {
unregisterUpdateHandler(updateHandler);
skip();
}
}
@Override public void reset() {}
};
registerUpdateHandler(updateHandler);
}