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); }
public UITextureContainer( String name, ColorRGBA color, int sizeX, int sizeY, int posX, int posY, int zOrder, UIContainer parentContainer) { this(name, sizeX, sizeY, posX, posY, zOrder, parentContainer); visibleQuad.setSolidColor(color); visibleQuad.updateRenderState(); }
public void setTextureState(TextureState ts) { visibleQuad.setRenderState(ts); visibleQuad.updateRenderState(); }