Hello,
I managed to make nifty works on android but It is displaying in the wrong resolution :
[java] @Override
public void simpleInitApp() {
NiftyJmeDisplay niftyDisplay = new NiftyJmeDisplay(assetManager,
inputManager,
audioRenderer,
guiViewPort);
System.out.println("resol cam = " + guiViewPort.getCamera().getWidth()+" " +guiViewPort.getCamera().getHeight() );
nifty = niftyDisplay.getNifty();
nifty.resolutionChanged();
System.out.println("resol = " + nifty.getRenderEngine().getWidth() + " " +nifty.getRenderEngine().getHeight());
nifty.fromXml("Interface/interface.xml", "start", new MainScreen(this));
guiViewPort.addProcessor(niftyDisplay);
this.setDisplayStatView(false);
// disable the fly cam
flyCam.setEnabled(false);
}[/java]
It always show : 640480 (instead of 480800) and so the interface is render in a 640480 canvas displaying on a 400800 screen…
If I shut down the screen, and then re power-on, unlock the phone, all is well drawn…
If there a way to have nifty in the right resolution at start ?
thanks
I digged a little in the source code and I managed to fix it like that :
[java]
@Override
public void start() {
super.start();
this.getContext().getSettings().setResolution(480, 800);
}[/java]
Is there a way to get the native device resolution? That should be set on the AppSettings at the initialization of AndroidHarness
@larynx: Maybe you can take a look at this?