I'm new to jMonkey, so please bear with me. I want to have a HUD with a dynamically generated image (a graph) in it, and can't get it working. This code (below, error checking removed for brevity) is stripped down to simply load an image, but it doesn't work either.
graphNode = new Node("graphNode");
Quad graph = new Quad("graphQuad", graphWidth, graphHeight);
graph.setRenderQueueMode(Renderer.QUEUE_ORTHO);
Vector3f graphVector = new Vector3f(500, 500, 0);
graph.setLocalTranslation(graphVector);
graph.setLightCombineMode(LightState.OFF);
//load image
BufferedImage bufImg = ImageIO.read(new File("/tmp/test.png"));
ImageGraphics graphics = ImageGraphics.createInstance(256, 256, 0);
graphics.drawImage(bufImg, 0, 256, null);
Texture texture = new Texture();
texture.setFilter(Texture.MM_LINEAR);
texture.setImage(graphics.getImage());
//create texture state for graph
graphTextureState = DisplaySystem.getDisplaySystem().getRenderer().createTextureState();
graphTextureState.setTexture(texture);
graphTextureState.setEnabled(true);
graph.setRenderState(graphTextureState);
graph.updateRenderState();
graphNode.attachChild(graph);
rootNode.attachChild(graphNode);
rootNode.updateRenderState();
When I run it, there is a 256x256 piece of the scene blocked by the HUD (as it should, in the correct place), but nothing appears except blackness. The animation behind it continues as normal, and appears if it's not behind the HUD.
I've been fighting this for the past two days and am completely out of ideas. Any ideas?
thanks
mike