Example usage for android.opengl GLES20 GL_ONE_MINUS_SRC_ALPHA

List of usage examples for android.opengl GLES20 GL_ONE_MINUS_SRC_ALPHA

Introduction

In this page you can find the example usage for android.opengl GLES20 GL_ONE_MINUS_SRC_ALPHA.

Prototype

int GL_ONE_MINUS_SRC_ALPHA

To view the source code for android.opengl GLES20 GL_ONE_MINUS_SRC_ALPHA.

Click Source Link

Usage

From source file:Main.java

/**
 * Sets up opengl to perform standard alpha transparency
 *//*from   w  ww.  ja v a2s. c  o  m*/
public static void enableAlphaTransparency() {
    GLES20.glEnable(GLES20.GL_BLEND);
    GLES20.glBlendFunc(GLES20.GL_SRC_ALPHA, GLES20.GL_ONE_MINUS_SRC_ALPHA);
}

From source file:fr.plnech.igem.game.AbstractGameActivity.java

private void initMenuPause() {
    pauseScene = new MenuScene(gameCamera, this);
    final ITextureRegion textureNext = getTexture(ResMan.MENU_NEXT);
    final ITextureRegion textureReset = getTexture(ResMan.MENU_RESET);
    final ITextureRegion textureQuit = getTexture(ResMan.MENU_QUIT);

    nextPauseMenuItem = new SpriteMenuItem(OPTION_NEXT, textureNext, getVBOM());
    nextPauseMenuItem.setBlendFunction(GLES20.GL_SRC_ALPHA, GLES20.GL_ONE_MINUS_SRC_ALPHA);
    nextPauseMenuItem.setVisible(false);
    pauseScene.addMenuItem(nextPauseMenuItem);

    final SpriteMenuItem resetMenuItem = new SpriteMenuItem(OPTION_RESET, textureReset, getVBOM());
    resetMenuItem.setBlendFunction(GLES20.GL_SRC_ALPHA, GLES20.GL_ONE_MINUS_SRC_ALPHA);
    pauseScene.addMenuItem(resetMenuItem);

    final SpriteMenuItem quitMenuItem = new SpriteMenuItem(OPTION_QUIT, textureQuit, getVBOM());
    quitMenuItem.setBlendFunction(GLES20.GL_SRC_ALPHA, GLES20.GL_ONE_MINUS_SRC_ALPHA);
    pauseScene.addMenuItem(quitMenuItem);

    pauseScene.buildAnimations();//from w w  w. jav a  2 s.c o m
    pauseScene.setBackgroundEnabled(false);
    pauseScene.setOnMenuItemClickListener(this);
}

From source file:fr.plnech.igem.game.AbstractGameActivity.java

private void initMenuWin() {
    winScene = new MenuScene(gameCamera, this);
    final ITextureRegion textureNext = getTexture(ResMan.MENU_NEXT);
    final ITextureRegion textureReset = getTexture(ResMan.MENU_RESET);
    final ITextureRegion textureQuit = getTexture(ResMan.MENU_QUIT);

    nextWinMenuItem = new SpriteMenuItem(OPTION_NEXT, textureNext, getVBOM());
    nextWinMenuItem.setBlendFunction(GLES20.GL_SRC_ALPHA, GLES20.GL_ONE_MINUS_SRC_ALPHA);
    nextWinMenuItem.setVisible(false);/*from   w ww. j  av  a 2 s.c  o  m*/
    winScene.addMenuItem(nextWinMenuItem);

    final SpriteMenuItem resetMenuItem = new SpriteMenuItem(OPTION_RESET, textureReset, getVBOM());
    resetMenuItem.setBlendFunction(GLES20.GL_SRC_ALPHA, GLES20.GL_ONE_MINUS_SRC_ALPHA);
    winScene.addMenuItem(resetMenuItem);

    final SpriteMenuItem quitMenuItem = new SpriteMenuItem(OPTION_QUIT, textureQuit, getVBOM());
    quitMenuItem.setBlendFunction(GLES20.GL_SRC_ALPHA, GLES20.GL_ONE_MINUS_SRC_ALPHA);
    winScene.addMenuItem(quitMenuItem);

    winScene.buildAnimations();
    winScene.setBackgroundEnabled(false);
    winScene.setOnMenuItemClickListener(this);
}