Loading bar

Hi :smiley:

Does anyone know how to make a loading bar? (a bar that's start going up and down when a buttom get pushed down)

Not sure what you're referring to in the parenthesis, but take a look at TestLoadingGameState, I think that's what you're looking for.

ok  :slight_smile: I will, thx

wow, this could be anything…



a status bar (like the gauge180 tests that the display is filled in as the value goes up)

a dynamic display bar (like in the hud tutorial)

a loading bar (like already mentioned)

a scrolling list pane (like swing or bui or fenggui)



or many other things… can you give a better description or a screenshot of something similar?

I was thinking about getting a functional bar in the hud. The bar is representing power, and it should fill up by pressing and holding a certain key down. The bar stops by realesing the key. The key can be hold as long as u want too, which means that the power bar must begin to move downwords as it reaches the top.

I think you need to read more of the tutorials.



http://www.jmonkeyengine.com/wiki/doku.php?id=huds_for_the_total_noob

http://www.jmonkeyengine.com/wiki/doku.php?id=displaying_dynamic_values_in_the_hud

also: http://www.jmonkeyengine.com/wiki/doku.php?id=progress_bar

mud2005 said:

also: http://www.jmonkeyengine.com/wiki/doku.php?id=progress_bar


I'm trying to use that code in my project.

However, I get this error:
The method setTextureBuffer(int, FloatBuffer) in the type Geometry is not applicable for the arguments (FloatBuffer)

Probably because the code is from 2006 something has changed in jME.

Can someone help me?

Thanks!
Probably because the code is from 2006 something has changed in jME.

Yes, it changed a lot...

You should move all your code to 1.0 release, downloadable from the site. Or better, take some time to learn how to checkout from the CVS, so you can have the bug-fixed version all the time.

It's not my code, it's the code from the wiki.



I already use jME 1.0 RC1



Thanks for your help.

Ah, ok… Sorry… Fast response…:smiley:

i think hes talking about a scrolling bar which is used in GUI.



if my guess is right, u should look at FengGUI

I'm talking about the code we can find at this adress, on the wiki:

http://www.jmonkeyengine.com/wiki/doku.php?id=progress_bar



When I try to compile this code

I get the error



The method setTextureBuffer(int, FloatBuffer) in the type Geometry is not applicable for the arguments (FloatBuffer) 



From that line:

hudQuad.setTextureBuffer(texCoords);



The last modification date from the wiki page is 2006, that's why I said that the code may be outdated. So I want to know if someone knows how to fix that line of code so I can compile the class.

hudQuad.setTextureBuffer(0, texCoords);


Since the progress bar code was created geometry batches have been introduced, requiring any geometry call to specify a batch index.
The same applies to gauge.setTextureBuffer(texCoords3); later in the code.
HTH

i updated the Wiki to use the new Method and added a TestProgressBar, to show off the ProgressBar easier.