Example usage for com.badlogic.gdx.graphics.g2d Batch getBlendSrcFunc

List of usage examples for com.badlogic.gdx.graphics.g2d Batch getBlendSrcFunc

Introduction

In this page you can find the example usage for com.badlogic.gdx.graphics.g2d Batch getBlendSrcFunc.

Prototype

public int getBlendSrcFunc();

Source Link

Usage

From source file:com.esotericsoftware.spine.utils.SkeletonDrawable.java

License:Open Source License

public void draw(Batch batch, float x, float y, float width, float height) {
    int blendSrc = batch.getBlendSrcFunc(), blendDst = batch.getBlendDstFunc();
    int blendSrcAlpha = batch.getBlendSrcFuncAlpha(), blendDstAlpha = batch.getBlendDstFuncAlpha();

    skeleton.setPosition(x, y);/*from  ww w  . ja  v a2 s.c  o m*/
    skeleton.updateWorldTransform();
    renderer.draw(batch, skeleton);

    if (resetBlendFunction)
        batch.setBlendFunctionSeparate(blendSrc, blendDst, blendSrcAlpha, blendDstAlpha);
}

From source file:net.mwplay.cocostudio.ui.particleutil.CCParticleActor.java

License:Apache License

protected void drawParticles(Batch batch) {
    int srcFunc = batch.getBlendSrcFunc();
    int dstFunc = batch.getBlendDstFunc();
    batch.setBlendFunction(blendSrc, blendDst);
    //System.out.println("_particleCount:"+_particleCount);
    for (int i = 0; i < _particleCount; i++) {
        batch.draw(m_pTexture, vertices[i], 0, 20);
    }/* ww w.j a v  a2s .c om*/
    batch.setBlendFunction(srcFunc, dstFunc);
    //        batch.setBlendFunction(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA);
}