I am trying some very basic tests with niftygui and very little seems to work. The current stuff that doesn’t work that does work as a mac app is that I put a panel with text in one of the four sides of the screen (right, left, top, bottom) and the panel will not respond to any touch/tap/drag events.
Here is the current xml (uses the right side placement):
[java]
<?xml version=“1.0” encoding=“UTF-8”?>
<nifty>
<screen id=“start” controller=“mygame.Main”>
<layer id=“layer” backgroundColor="#0000" childLayout=“center”>
<panel id=“panel” height=“25%” width=“35%” align=“right” valign=“center” backgroundColor="#f60f" childLayout=“center” visibleToMouse=“true”>
<text id=“myText” font=“Interface/Fonts/Baskerville25.fnt” color="#000f" text=“Menu” align=“center” valign=“center” />
<interact onClick=“sayHello(hi)”/>
</panel>
</layer>
</screen>
</nifty>
[/java]
Morris
Yes it does but not in the version that is currently bundled with jme3, we’ll update the nifty libraries soon for android compatibility (next few days, before beta).
Great, thanks.
Morris
I have an other issue too :
When you load a bitmap in the interface, if the phone goes into sleep mode, when you turn on, and unlock it : the application is resumed and crashes with an error : the bitmap was garbage collected
Looks like the same problem with niftygui is still there, ie, not responding to touches in off-center windows. Also, a new problem has appeared in the area. One of the tests I am using moves a block into the center then responds to a touch to call a method back in the android program. Before beta this would work in the center of the screen at least. Now I touch-drag into the nifty window and the pulsate starts then I touch the window to fire the interact. I see android register a ‘processMouseEvent’ but nifty does not respond.
Wow! I just went to click the window again to see what the event was called and had to bring the android screen up. After the screen came up the touch caused the method to be called and continues to do it. If I stop the app and restart I have to shut the screen off and turn it back on to get the touches to work.
Attached is the xml.
Morris
[xml]<?xml version=“1.0” encoding=“UTF-8”?>
<nifty>
<screen id=“start” controller=“mygame.Main”>
<layer id=“layer” backgroundColor="#0000" childLayout=“center”>
<panel id=“panel” height=“25%” width=“35%” align=“center” valign=“center” backgroundColor="#f60f" childLayout=“center” visibleToMouse=“true”>
<effect>
<onStartScreen name=“move” mode=“in” direction=“top” length=“4400” startDelay=“0” inherit=“true”/>
<onEndScreen name=“move” mode=“out” direction=“bottom” length=“300” startDelay=“0” inherit=“true”/>
<onHover name=“pulsate” scaleFactor=“0.008” startColor="#f600" endColor="#ffff" post=“true”/>
</effect>
<text id=“myText” font=“Interface/Fonts/Baskerville25.fnt” color="#000f" text=“Menu” align=“center” valign=“center” />
<interact onClick=“sayHello(hi)”/>
</panel>
</layer>
</screen>
</nifty>
[/xml]