Ejemplo n.º 1
0
  public UITextureContainer(String name, int sizeX, int sizeY, int posX, int posY, int zOrder) {

    super(name, posX, posY, zOrder, sizeX, sizeY);

    visibleQuad = new Quad(name + "UIQuad", sizeX, sizeY);
    visibleQuad.setRenderQueueMode(Renderer.QUEUE_ORTHO);
    visibleQuad.setZOrder(zPos);

    visibleQuad.setLocalTranslation((sizeX / 2.0f), (sizeY / 2.0f), 0);

    if (as == null) {
      as =
          DisplaySystem.getDisplaySystem()
              .getRenderer()
              .createBlendState(); // FIXME: Remove the hidden OpenGL call.
      as.setBlendEnabled(true);
      as.setSourceFunction(BlendState.SourceFunction.SourceAlpha);
      as.setDestinationFunction(BlendState.DestinationFunction.OneMinusSourceAlpha);
      as.setTestEnabled(true);
      as.setTestFunction(BlendState.TestFunction.GreaterThan);
    }
    visibleQuad.setRenderState(as);
    visibleQuad.updateRenderState();
    getDisplayNode().attachChild(visibleQuad);
  }
Ejemplo n.º 2
0
 public void setTextureState(TextureState ts) {
   visibleQuad.setRenderState(ts);
   visibleQuad.updateRenderState();
 }