StandardGame examples?

I was wondering if there are more examples of StandardGame usage, particularly in how to update the rendering of a quad from within a class.

I am working on a HUD for learning.  The bar class creates a quad and modifies its size based on its current value.  Creating the quad works perfectly, and the setSize function works - but only on the first call.

In my test program I create StandardGame and 2 GameStates - one for a Cylinder, and one for the hud.  I also create a thread that when run sets the value of the bar to a random value between the min/max and sleeps for 1000 ms.  The bar calculates the correct size to display, resizes the quad, and then either explodes or does nothing - depending on the functions called.

Calling updateRenderState() on the quad itself works once, but fails to continue updating.

Calling updateRenderState() on the Node causes a nullPointerException.

Sadly, most of the other examples are done using jME1, so I haven't found a good example of a multi-threaded program using jME2 and StandardGame as a reference.

in this thread:

i attached a little example with 3 gamestates and standardgame.

maybe it helps to get started.

Thanks, I did finally figure it out and it was just one of those… /facepalm  moments…  It would help if my thread actually had a while loop, so it would call the function more than once.  Sometimes you get so focused on trying to fix the hard stuff that you overlook the simple stuff.

Now to try and texture the bar.  :smiley: