Hello, I 've developed the logic of my game and now I’m trying to do the GUI, I follow this guide https://wiki.jmonkeyengine.org/legacy/doku.php/jme3:advanced:nifty_gui_xml_layout
and I’ve used the equal example , this is the relative code :
[java]
<?xml version=“1.0” encoding=“UTF-8”?>
<nifty xmlns=“http://nifty-gui.sourceforge.net/nifty-1.3.xsd”
xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance”
xsi:schemaLocation=“http://nifty-gui.sourceforge.net/nifty-1.3.xsd”>
<useStyles filename=“nifty-default-styles.xml” />
<useControls filename=“nifty-default-controls.xml” />
<screen id=“start” controller=“Start.MyStartScreen” >
<layer id=“background” backgroundColor="#00FFFF" childLayout=“center”>
<image filename=“assets/mgr.jpg”> </image>
</layer>
<layer id="foreground" backgroundColor="#0000" childLayout="vertical">
<panel id="panel_top" height="25%" width="75%" align="center" childLayout="center"
backgroundColor="#f008">
</panel>
<panel id="panel_mid" height="50%" width="75%" align="center" childLayout="center"
backgroundColor="#0f08">
</panel>
<panel id="panel_bottom" height="25%" width="75%" align="center" childLayout="horizontal" backgroundColor="#00f8">
<panel id="panel_bottom_left" height="50%" width="50%" valign="center" childLayout="center">
<control name="button" label="Start" id="StartButton" align="center" valign="center" visibleToMouse="true" >
<interact onClick="startGame(hud)"/>
</control>
</panel>
<panel id="panel_bottom_right" height="50%" width="50%" valign="center" childLayout="center">
<control name="button" label="Quit" id="QuitButton" align="center" valign="center" visibleToMouse="true" >
<interact onClick="quitGame()"/>
</control>
</panel>
</panel>
</layer>
</screen>
<screen id=“hud” controller= “NiftyTest.MyStartScreen”>
<layer id=“background” >
</layer>
<layer id="foreground" backgroundColor="#0000" childLayout="horizontal">
<panel id="panel_left" width="80%" height="100%" childLayout="vertical"
backgroundColor="#0f08">
<!-- spacer -->
</panel>
<panel id="panel_right" width="20%" height="100%" childLayout="vertical"
backgroundColor="#00f8" >
<panel id="panel_top_right1" width="100%" height="15%" childLayout="center"
backgroundColor="#00f8">
</panel>
<panel id="panel_top_right2" width="100%" height="15%" childLayout="center"
backgroundColor="#44f8">
</panel>
<panel id="panel_bot_right" width="100%" height="70%" valign="center"
backgroundColor="#88f8">
</panel>
</panel>
</layer>
</screen>
</nifty>
[/java]
When I push run, I’ve the screen id=“screen” when I click for start my game, it change the screen in (id=“hud”) for lifepoint ,score ecc. but I’ve problem with logic:
becouse my game is an fps game, and with the mouse I control the cam rotation of player,so, when the game is running and the GUI is in the hud screen it’s impossible to use the mouse for cam rotation, and I 've on the screen the mouse arrow (it’is not good) . I can just move with(ASDW) and hit with sx mouse button.
How can I remedy?
Thanks in advance