First of all, my intention is to get a console in a popup persisten through screens. In other words I want to have a console at any time in the game shown by pressing [ESC].
I begin by loading the XML file in the “mainScreen”. At this point I can perfectly use the console, which I toogle(add and close) using the [ESC] key. I have already created a “loginPopup”. When I login to the server and I receive the player information I gotoScreen(“gameScreen”). Now I can toogle the “consolePopup” element stored before and it shows and hides fine, keeping it’s previous state, but it doesn’t get any input from the keyboard.
My guess is that the console gets binded to the “mainScreen” input, and this is no longer receiving any events.
I’ve already tried everything I’ve seen all over the web(bind, layout, setParent…) and nothing did the trick…
I am trying to achieve this the wrong way? I am not experienced with nifty-gui…
- I also tried using the same screenController in both screens.
Any help would be sincerely appreciated.
An extract from the main XML:
16
17
18
19
20
21
22
23
24 <panel childLayout=“absolute” x=“8” y=“10” width=“554” height=“92”
25 visibleToMouse=“true”>
26 <control x=“5” y=“0” width=“540” height=“92” id=“gameLog”
27 name=“listBox” vertical=“optional” horizontal=“optional”
28 displayItems=“6” wrap=“true” selectionMode=“Disabled” />
29
30 <panel childLayout=“absolute” x=“18” y=“108” width=“535”
31 height=“18”>
32 <control x=“0” y=“0” width=“535” height=“18” id=“gameConsole”
33 name=“textfield” text="" />
34
35
36
73
74
75 <panel align=“center” childLayout=“center” valign=“center”
76 width=“95%”>
77 <control id=“console” name=“nifty-console” align=“center”
78 lines=“40” valign=“center”>
79
80 <onCustom name=“move” alternateEnable=“show” direction=“top”
81 inherit=“true” length=“200” mode=“in” startDelay=“0” />
82
83 <onCustom name=“move” alternateEnable=“hide” direction=“top”
84 inherit=“true” length=“200” mode=“out” startDelay=“0” />
85
86
87
88
Thank you all very much!!!