当前位置: 首页>>代码示例>>Java>>正文


Java ParticleEffect.update方法代码示例

本文整理汇总了Java中com.badlogic.gdx.graphics.g2d.ParticleEffect.update方法的典型用法代码示例。如果您正苦于以下问题:Java ParticleEffect.update方法的具体用法?Java ParticleEffect.update怎么用?Java ParticleEffect.update使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.badlogic.gdx.graphics.g2d.ParticleEffect的用法示例。


在下文中一共展示了ParticleEffect.update方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
 
开发者ID:Mignet,项目名称:Inspiration,代码行数:26,代码来源:BattleUI.java

示例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;
}
 
开发者ID:Rubentxu,项目名称:Entitas-Java,代码行数:23,代码来源:ActuatorEntity.java

示例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;
}
 
开发者ID:Rubentxu,项目名称:Entitas-Java,代码行数:24,代码来源:ActuatorEntity.java

示例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();
}
 
开发者ID:kotcrab,项目名称:vis-editor,代码行数:20,代码来源:ParticleRenderSystem.java

示例5: draw

import com.badlogic.gdx.graphics.g2d.ParticleEffect; //导入方法依赖的package包/类
public static void draw() {
	GameMain.instance.activeStage.getBatch().begin();
	for (ParticleEffect particleEffect : effects) {
		particleEffect.draw(GameMain.instance.activeStage.getBatch());
		particleEffect.update(Gdx.graphics.getDeltaTime());
	}
	GameMain.instance.activeStage.getBatch().end();
}
 
开发者ID:cn-s3bit,项目名称:TH902,代码行数:9,代码来源:ParticleSystem.java

示例6: 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();

    };
}
 
开发者ID:Rubentxu,项目名称:Entitas-Java,代码行数:13,代码来源:ParticleEffectActuator.java

示例7: update

import com.badlogic.gdx.graphics.g2d.ParticleEffect; //导入方法依赖的package包/类
@Override
public void update(float deltaTime) {
    super.update(deltaTime);
    renderQueue.sort(comparator);
    camera.update();
    batch.setProjectionMatrix(camera.combined);

    batch.begin();

    for (View view : renderQueue) {
        if (view.tint != null) {
            batch.setColor(view.tint);
        } else {
            batch.setColor(Color.WHITE);
        }
        batch.getColor().a = view.opacity;

        if (view instanceof ParticleEffectView) {

            ParticleEffect effect = ((ParticleEffectView) view).effect;
            effect.setPosition(view.position.x, view.position.y);
            effect.update(deltaTime);
            if (((ParticleEffectView) view).autoStart) {
                effect.start();
                ((ParticleEffectView) view).autoStart = false;
            }
            effect.draw(batch);

        } else if (TextureView.class.isAssignableFrom(view.getClass())) {
            TextureView textureView = (TextureView) view;

            if(textureView.textureRegion != null) {
                processTextureFlip(textureView);
                float originX = textureView.width * 0.5f;
                float originY = textureView.height * 0.5f;

                batch.draw(textureView.textureRegion, textureView.position.x - originX, textureView.position.y - originY,
                        originX, originY, textureView.width, textureView.height, 1, 1, textureView.rotation);

            }
            // Gdx.app.log("RederingSystem", "texture width " + textureView.width + " height " + textureView.height
            //        + " texture position " + textureView.position);
        }


    }
    debugDrawUI();
    batch.end();
    renderQueue.clear();
    debugDrawWorld();


}
 
开发者ID:Rubentxu,项目名称:GDX-Logic-Bricks,代码行数:54,代码来源:RenderingSystem.java


注:本文中的com.badlogic.gdx.graphics.g2d.ParticleEffect.update方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。