當前位置: 首頁>>代碼示例>>Java>>正文


Java ParticleEffect.draw方法代碼示例

本文整理匯總了Java中com.badlogic.gdx.graphics.g2d.ParticleEffect.draw方法的典型用法代碼示例。如果您正苦於以下問題:Java ParticleEffect.draw方法的具體用法?Java ParticleEffect.draw怎麽用?Java ParticleEffect.draw使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.badlogic.gdx.graphics.g2d.ParticleEffect的用法示例。


在下文中一共展示了ParticleEffect.draw方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: update

import com.badlogic.gdx.graphics.g2d.ParticleEffect; //導入方法依賴的package包/類
@Override
public void update(float deltaTime) {
    Gdx.gl.glClearColor(bgColour[0], bgColour[1], bgColour[2], bgColour[3]);
    Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT);
    batch.setProjectionMatrix(camera.combined);

    batch.begin();
    super.update(deltaTime);
    for (ParticleEffect particle : particles) particle.draw(batch, deltaTime);
    batch.end();

    if (ZeroBit.debugEnabled) {
        shapeRenderer.setProjectionMatrix(camera.combined);
        shapeRenderer.begin(ShapeRenderer.ShapeType.Line);
            for (Entity entity : getEntities()) debugRender(entity);
        shapeRenderer.end();
    }
}
 
開發者ID:ALPSquid,項目名稱:0Bit-Engine,代碼行數:19,代碼來源:RenderingSystem.java

示例2: 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

示例3: 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

示例4: draw

import com.badlogic.gdx.graphics.g2d.ParticleEffect; //導入方法依賴的package包/類
@Override
public void draw(Batch batch, float parentAlpha){
    super.draw(batch, parentAlpha);

    //Draw the particles last
    for( int i = 0; i < _effects.size; i++){
        ParticleEffect effect = _effects.get(i);
        if( effect == null ) continue;
        effect.draw(batch);
    }
}
 
開發者ID:Mignet,項目名稱:Inspiration,代碼行數:12,代碼來源:BattleUI.java

示例5: 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();
}
 
開發者ID:Deftwun,項目名稱:ZombieCopter,代碼行數:15,代碼來源:ParticleSystem.java

示例6: render

import com.badlogic.gdx.graphics.g2d.ParticleEffect; //導入方法依賴的package包/類
private void render(Entity entity, float deltaTime) {
    visc = vism.get(entity);
    sprtc = sprtm.get(entity);
    nodec = nodem.get(entity);
    pc = pm.get(entity);
    if (pc != null) {
        for (ParticleEffect particle : pc.getParticles()) particle.draw(batch, deltaTime);
    }
    if (sprtc != null) {
        sprtc.player.update();
        sprtc.drawer.draw(sprtc.player, batch);
    } else if (visc != null && visc.sprite.getTexture() != null) {
        if (nodec == null || ZeroBit.debugRender) visc.sprite.draw(batch);
    }
}
 
開發者ID:ALPSquid,項目名稱:0Bit-Engine,代碼行數:16,代碼來源:RenderingSystem.java

示例7: _render

import com.badlogic.gdx.graphics.g2d.ParticleEffect; //導入方法依賴的package包/類
@Override
public void _render(SpriteBatch spriteBatch)
{
    if(!visible)return;
    TextureRegion frame = animation.getKeyFrame(stateTime, true);
    Utility.draw(spriteBatch, frame, position.x, position.y, mDrawRect.height);

    ParticleEffect effect = world.screen.game.assets.manager.get("data/animation/particles/fireplant_emitter.p", ParticleEffect.class);
    effect.setPosition(position.x + mDrawRect.width / 2, position.y + mDrawRect.height / 2);
    effect.draw(spriteBatch, Gdx.graphics.getDeltaTime());
}
 
開發者ID:pedja1,項目名稱:SMC-Android,代碼行數:12,代碼來源:Fireplant.java

示例8: 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.draw方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。