本文整理匯總了Java中com.badlogic.gdx.graphics.g2d.ParticleEffect.isComplete方法的典型用法代碼示例。如果您正苦於以下問題:Java ParticleEffect.isComplete方法的具體用法?Java ParticleEffect.isComplete怎麽用?Java ParticleEffect.isComplete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.badlogic.gdx.graphics.g2d.ParticleEffect
的用法示例。
在下文中一共展示了ParticleEffect.isComplete方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: act
import com.badlogic.gdx.graphics.g2d.ParticleEffect; //導入方法依賴的package包/類
@Override
public void act(float delta){
battleTimer = (battleTimer + delta)%60;
if( damageValLabel.isVisible() && damageValLabel.getY() < this.getHeight()){
damageValLabel.setY(damageValLabel.getY()+5);
}
if( battleShakeCam != null && battleShakeCam.isCameraShaking() ){
Vector2 shakeCoords = battleShakeCam.getNewShakePosition();
_image.setPosition(shakeCoords.x, shakeCoords.y);
}
for( int i = 0; i < _effects.size; i++){
ParticleEffect effect = _effects.get(i);
if( effect == null ) continue;
if( effect.isComplete() ){
_effects.removeIndex(i);
effect.dispose();
}else{
effect.update(delta);
}
}
super.act(delta);
}
示例2: addParticleEffectActuator
import com.badlogic.gdx.graphics.g2d.ParticleEffect; //導入方法依賴的package包/類
public ActuatorEntity addParticleEffectActuator(ParticleEffect effect,
boolean autoStart, float locaPosX, float locaPosY) {
ParticleEffectActuator component = (ParticleEffectActuator) recoverComponent(ActuatorComponentsLookup.ParticleEffectActuator);
if (component == null) {
component = new ParticleEffectActuator(effect, autoStart, locaPosX,
locaPosY);
} else {
component.particleEffect = effect;
component.actuator = (indexOwner) -> {
GameEntity owner = Indexed.getInteractiveEntity(indexOwner);
RigidBody rc = owner.getRigidBody();
Transform transform = rc.body.getTransform();
effect.setPosition(transform.getPosition().x + locaPosX,
transform.getPosition().y + locaPosY);
effect.update(Gdx.graphics.getDeltaTime());
if (autoStart && effect.isComplete())
effect.start();
};
}
addComponent(ActuatorComponentsLookup.ParticleEffectActuator, component);
return this;
}
示例3: replaceParticleEffectActuator
import com.badlogic.gdx.graphics.g2d.ParticleEffect; //導入方法依賴的package包/類
public ActuatorEntity replaceParticleEffectActuator(ParticleEffect effect,
boolean autoStart, float locaPosX, float locaPosY) {
ParticleEffectActuator component = (ParticleEffectActuator) recoverComponent(ActuatorComponentsLookup.ParticleEffectActuator);
if (component == null) {
component = new ParticleEffectActuator(effect, autoStart, locaPosX,
locaPosY);
} else {
component.particleEffect = effect;
component.actuator = (indexOwner) -> {
GameEntity owner = Indexed.getInteractiveEntity(indexOwner);
RigidBody rc = owner.getRigidBody();
Transform transform = rc.body.getTransform();
effect.setPosition(transform.getPosition().x + locaPosX,
transform.getPosition().y + locaPosY);
effect.update(Gdx.graphics.getDeltaTime());
if (autoStart && effect.isComplete())
effect.start();
};
}
replaceComponent(ActuatorComponentsLookup.ParticleEffectActuator,
component);
return this;
}
示例4: process
import com.badlogic.gdx.graphics.g2d.ParticleEffect; //導入方法依賴的package包/類
@Override
protected void process (int entityId) {
VisParticle particle = particleCm.get(entityId);
Transform transform = transformCm.get(entityId);
ParticleEffect effect = particle.getEffect();
if (transform.isDirty()) {
particle.updateValues(transform.getX(), transform.getY());
}
if (ignoreActive || particle.isActiveOnStart())
effect.update(world.delta);
effect.draw(batch);
if (effect.isComplete())
effect.reset();
}
示例5: ParticleEffectActuator
import com.badlogic.gdx.graphics.g2d.ParticleEffect; //導入方法依賴的package包/類
public ParticleEffectActuator(ParticleEffect effect, boolean autoStart, float locaPosX, float locaPosY) {
this.particleEffect = effect;
this.actuator = (indexOwner)-> {
GameEntity owner = Indexed.getInteractiveEntity(indexOwner);
RigidBody rc = owner.getRigidBody();
Transform transform = rc.body.getTransform();
effect.setPosition(transform.getPosition().x + locaPosX, transform.getPosition().y + locaPosY);
effect.update(Gdx.graphics.getDeltaTime());
if(autoStart && effect.isComplete()) effect.start();
};
}
示例6: render
import com.badlogic.gdx.graphics.g2d.ParticleEffect; //導入方法依賴的package包/類
public void render(float deltaTime){
batch.setProjectionMatrix(App.engine.systems.camera.getViewport().getCamera().combined);
batch.begin();
for (ParticleEffect e : effects){
if (e.isComplete()){
finishedEffects.add(e);
logger.debug("effect complete");
}
else
e.draw(batch,deltaTime);
}
batch.end();
}