Hello,
the purpose of this project was to get a small, fast, easy to use hud system for JME3. This system is not ment to replace Nifty since it will probably never incorportate that amout of features.
The system is targeting programmers, since the only way to generate them is currently trought code.
The whole system is ‘percentage based’, so it will always adjut automatically to the selected resolution. Additionally the system is build so that you can register 4 different listeners on each HudObject, and for the simplicity they are automatically called on the render thread.
Here is a short video showing a simple mouseover effect, simple buttons, and toggleButtons
http://www.youtube.com/watch?v=8inME7x9KHU
The usage is quite simple:
Load the HudManager and attach it
[java]
hudManager = new RPHudManager(this);
this.stateManager.attach(hudManager);
[/java]
Create a Sceen:
[java]
RPHudScreen screen1 = new RPHudScreen("Screen1", this.cam);
[/java]
Now you can add content to the screen, a simple colored background would be:
[java]
RPHudBackground rpHudBackground = new RPHudBackground("BG1", new Vector2f(0.25f, 0.25f), new Vector2f(0.5f, 0.5f), material);
screen1.addChildComponent(rpHudBackground);
[/java]
Note the two Vector2f's. The fist one is the relative position to the parent component, while the second one is the relative size. (Position is starting from bottom left), according to this the above code creates a colored quad in the center of the screen with size x*0.5, y*0.5)
Once done with the layout the call of
[java]
screen1.doLayout(0);
[/java]
Calculated the absolute layout of each component. The 0 is the starting depth, each subcompnent has depth+1 of its parent component by default. It is also possible to set a depthmodifier for each component.
If you want to show the screen simply activate it with following command:
[java]
hudManager.activateScreen(screen1);
[/java]
At last, it is easily possible to register actions for the hudsystem
[java]
hudManager.addMouseInputAction(MouseInput.BUTTON_LEFT, "ButtonLeft");
[/java]
This is just for a brief explanation.
If there is interest in such a system i will make a plugin out of it and contribute it.
Also if it get's contributed what default features should it have?
Planned are sliders and tab's-