Help using Nifty-gui as an overlay (slick2d)

Ian Norton
2012-04-01
2012-08-28
  • Ian Norton
    Ian Norton
    2012-04-01

    Hi all, I’m using this code for my main menu state, and I took out
    the ‘extends world’ and made an InGameMenu class.

    I can get Nifty to render when I press the escape key, but I don’t know how to
    forward inputs to it (it works fine for the main menu, but not in-game). My
    inputs still control the game, instead of Nifty. I also get loads of error
    messages when I call my InGameMenu:

    Apr 1, 2012 4:28:46 PM de.lessvoid.nifty.Nifty initialize
    WARNING: An event service by the name NiftyEventBusalready exists.  Perhaps multiple threads tried to create a service about the same time?
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: error: null
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: sun.reflect.NativeMethodAccessorImpl:null:invoke0:-2
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: sun.reflect.NativeMethodAccessorImpl:null:invoke:-1
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: sun.reflect.DelegatingMethodAccessorImpl:null:invoke:-1
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: java.lang.reflect.Method:null:invoke:-1
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.xml.tools.MethodInvoker:MethodInvoker.java:callMethod:153
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.xml.tools.MethodInvoker:MethodInvoker.java:invoke:125
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.xml.tools.SpecialValuesReplace:SpecialValuesReplace.java:handleCall:154
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.xml.tools.SpecialValuesReplace:SpecialValuesReplace.java:replace:71
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.xml.xpp3.Attributes:Attributes.java:translateSpecialValues:59
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.nifty.loaderv2.types.XmlBaseType:XmlBaseType.java:translateSpecialValues:25
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.nifty.loaderv2.types.ElementType:ElementType.java:translateSpecialValues:295
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.nifty.loaderv2.types.ElementType:ElementType.java:translateSpecialValues:299
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.nifty.loaderv2.types.ElementType:ElementType.java:translateSpecialValues:299
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.nifty.loaderv2.types.ElementType:ElementType.java:translateSpecialValues:299
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.nifty.loaderv2.types.ElementType:ElementType.java:prepare:285
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.nifty.loaderv2.types.ScreenType:ScreenType.java:create:73
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.nifty.loaderv2.types.NiftyType:NiftyType.java:create:137
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.nifty.Nifty:Nifty.java:loadFromFile:528
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.nifty.Nifty:Nifty.java:fromXml:438
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: com.threelite.demonwars.menu.InGameMenu:InGameMenu.java:init:55
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: com.threelite.demonwars.systems.PlayerControlSystem:PlayerControlSystem.java:pauseGame:178
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: com.threelite.demonwars.systems.PlayerControlSystem:PlayerControlSystem.java:update:148
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: it.marteEngine.World:World.java:update:174
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: com.threelite.demonwars.worlds.World1:World1.java:update:106
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: org.newdawn.slick.state.StateBasedGame:StateBasedGame.java:update:268
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: org.newdawn.slick.GameContainer:GameContainer.java:updateAndRender:657
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: org.newdawn.slick.AppGameContainer:AppGameContainer.java:gameLoop:408
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: org.newdawn.slick.AppGameContainer:AppGameContainer.java:start:318
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: com.threelite.demonwars.DemonWars:DemonWars.java:main:44
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: error: null
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: sun.reflect.NativeMethodAccessorImpl:null:invoke0:-2
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: sun.reflect.NativeMethodAccessorImpl:null:invoke:-1
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: sun.reflect.DelegatingMethodAccessorImpl:null:invoke:-1
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: java.lang.reflect.Method:null:invoke:-1
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.xml.tools.MethodInvoker:MethodInvoker.java:callMethod:153
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.xml.tools.MethodInvoker:MethodInvoker.java:invoke:125
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.xml.tools.SpecialValuesReplace:SpecialValuesReplace.java:handleCall:154
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.xml.tools.SpecialValuesReplace:SpecialValuesReplace.java:replace:71
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.xml.xpp3.Attributes:Attributes.java:translateSpecialValues:59
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.nifty.loaderv2.types.XmlBaseType:XmlBaseType.java:translateSpecialValues:25
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.nifty.loaderv2.types.ElementType:ElementType.java:translateSpecialValues:295
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.nifty.loaderv2.types.ElementType:ElementType.java:translateSpecialValues:299
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.nifty.loaderv2.types.ElementType:ElementType.java:translateSpecialValues:299
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.nifty.loaderv2.types.ElementType:ElementType.java:translateSpecialValues:299
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.nifty.loaderv2.types.ElementType:ElementType.java:prepare:285
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.nifty.loaderv2.types.ScreenType:ScreenType.java:create:73
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.nifty.loaderv2.types.NiftyType:NiftyType.java:create:137
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.nifty.Nifty:Nifty.java:loadFromFile:528
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.nifty.Nifty:Nifty.java:fromXml:438
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: com.threelite.demonwars.menu.InGameMenu:InGameMenu.java:init:55
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: com.threelite.demonwars.systems.PlayerControlSystem:PlayerControlSystem.java:pauseGame:178
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: com.threelite.demonwars.systems.PlayerControlSystem:PlayerControlSystem.java:update:148
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: it.marteEngine.World:World.java:update:174
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: com.threelite.demonwars.worlds.World1:World1.java:update:106
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: org.newdawn.slick.state.StateBasedGame:StateBasedGame.java:update:268
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: org.newdawn.slick.GameContainer:GameContainer.java:updateAndRender:657
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: org.newdawn.slick.AppGameContainer:AppGameContainer.java:gameLoop:408
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: org.newdawn.slick.AppGameContainer:AppGameContainer.java:start:318
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: com.threelite.demonwars.DemonWars:DemonWars.java:main:44
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: error: null
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: sun.reflect.NativeMethodAccessorImpl:null:invoke0:-2
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: sun.reflect.NativeMethodAccessorImpl:null:invoke:-1
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: sun.reflect.DelegatingMethodAccessorImpl:null:invoke:-1
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: java.lang.reflect.Method:null:invoke:-1
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.xml.tools.MethodInvoker:MethodInvoker.java:callMethod:153
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.xml.tools.MethodInvoker:MethodInvoker.java:invoke:125
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.xml.tools.SpecialValuesReplace:SpecialValuesReplace.java:handleCall:154
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.xml.tools.SpecialValuesReplace:SpecialValuesReplace.java:replace:71
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.xml.xpp3.Attributes:Attributes.java:translateSpecialValues:59
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.nifty.loaderv2.types.XmlBaseType:XmlBaseType.java:translateSpecialValues:25
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.nifty.loaderv2.types.ElementType:ElementType.java:translateSpecialValues:295
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.nifty.loaderv2.types.ElementType:ElementType.java:translateSpecialValues:299
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.nifty.loaderv2.types.ElementType:ElementType.java:translateSpecialValues:299
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.nifty.loaderv2.types.ElementType:ElementType.java:translateSpecialValues:299
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.nifty.loaderv2.types.ElementType:ElementType.java:prepare:285
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.nifty.loaderv2.types.ScreenType:ScreenType.java:create:73
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.nifty.loaderv2.types.NiftyType:NiftyType.java:create:137
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.nifty.Nifty:Nifty.java:loadFromFile:528
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.nifty.Nifty:Nifty.java:fromXml:438
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: com.threelite.demonwars.menu.InGameMenu:InGameMenu.java:init:55
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: com.threelite.demonwars.systems.PlayerControlSystem:PlayerControlSystem.java:pauseGame:178
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: com.threelite.demonwars.systems.PlayerControlSystem:PlayerControlSystem.java:update:148
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: it.marteEngine.World:World.java:update:174
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: com.threelite.demonwars.worlds.World1:World1.java:update:106
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: org.newdawn.slick.state.StateBasedGame:StateBasedGame.java:update:268
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: org.newdawn.slick.GameContainer:GameContainer.java:updateAndRender:657
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: org.newdawn.slick.AppGameContainer:AppGameContainer.java:gameLoop:408
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: org.newdawn.slick.AppGameContainer:AppGameContainer.java:start:318
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: com.threelite.demonwars.DemonWars:DemonWars.java:main:44
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: error: null
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: sun.reflect.NativeMethodAccessorImpl:null:invoke0:-2
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: sun.reflect.NativeMethodAccessorImpl:null:invoke:-1
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: sun.reflect.DelegatingMethodAccessorImpl:null:invoke:-1
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: java.lang.reflect.Method:null:invoke:-1
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.xml.tools.MethodInvoker:MethodInvoker.java:callMethod:153
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.xml.tools.MethodInvoker:MethodInvoker.java:invoke:125
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.xml.tools.SpecialValuesReplace:SpecialValuesReplace.java:handleCall:154
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.xml.tools.SpecialValuesReplace:SpecialValuesReplace.java:replace:71
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.xml.xpp3.Attributes:Attributes.java:translateSpecialValues:59
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.nifty.loaderv2.types.XmlBaseType:XmlBaseType.java:translateSpecialValues:25
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.nifty.loaderv2.types.ElementType:ElementType.java:translateSpecialValues:295
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.nifty.loaderv2.types.ElementType:ElementType.java:translateSpecialValues:299
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.nifty.loaderv2.types.ElementType:ElementType.java:translateSpecialValues:299
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.nifty.loaderv2.types.ElementType:ElementType.java:translateSpecialValues:299
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.nifty.loaderv2.types.ElementType:ElementType.java:prepare:285
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.nifty.loaderv2.types.ScreenType:ScreenType.java:create:73
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.nifty.loaderv2.types.NiftyType:NiftyType.java:create:137
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.nifty.Nifty:Nifty.java:loadFromFile:528
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: de.lessvoid.nifty.Nifty:Nifty.java:fromXml:438
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: com.threelite.demonwars.menu.InGameMenu:InGameMenu.java:init:55
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: com.threelite.demonwars.systems.PlayerControlSystem:PlayerControlSystem.java:pauseGame:178
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: com.threelite.demonwars.systems.PlayerControlSystem:PlayerControlSystem.java:update:148
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: it.marteEngine.World:World.java:update:174
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: com.threelite.demonwars.worlds.World1:World1.java:update:106
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: org.newdawn.slick.state.StateBasedGame:StateBasedGame.java:update:268
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: org.newdawn.slick.GameContainer:GameContainer.java:updateAndRender:657
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: org.newdawn.slick.AppGameContainer:AppGameContainer.java:gameLoop:408
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: org.newdawn.slick.AppGameContainer:AppGameContainer.java:start:318
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker callMethod
    WARNING: com.threelite.demonwars.DemonWars:DemonWars.java:main:44
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker invoke
    WARNING: invoke for method [getGCWidthAsString()] failed
    Apr 1, 2012 4:28:47 PM de.lessvoid.xml.tools.MethodInvoker invoke
    WARNING: invoke for method [getGCHeightAsString()] failed
    

    Any help would be GREATLY appreciated! I’ve tried getting this to work for a
    couple days now and just about at my wit’s end! Thanks for any help I get here
    :)

     
  • Nitram
    Nitram
    2012-04-01

    Hello,

    the part that actually causes the problem is not part of the published source
    code.

    com.threelite.demonwars.menu.InGameMenu:InGameMenu.java:init:55 is the last
    place in your source code before the stack goes to die inside Nifty.

    Two questions:

    1. Why don't you use the current version of Nifty (1.3.1)?
    2. Why don't you use the renderer that was made for Slick2D?

    Nitram

     
  • Ian Norton
    Ian Norton
    2012-04-01

    I am using Nifty 1.3.1, and I am using nifty-slick-renderer-1.3.1.jar.

    Line 55 of InGameMenu is nifty.fromXml("data/xml/ingamemenu.xml", "main",
    controller);

    Thanks for your response!

     
  • Ian Norton
    Ian Norton
    2012-04-01

    Is there a working example somewhere of the instructions
    here? I scrapped what I
    had and tried following that. I just don't quite understand how to set up my
    class that extends NiftyOverlayGameState.

     
  • Ian Norton
    Ian Norton
    2012-04-02

    Here's my class that extends
    NiftyOverlayGameState. Can you tell me if I'm doing anything wrong there? I
    know the inputs may be messed up, but I can't get it to render.

    Also, I don't know exactly how to call it. All I do is create a new InGameMenu
    object when escape is pressed, but nothing gets rendered from Nifty-gui.

     
  • Nitram
    Nitram
    2012-04-10

    Okay what you did is vastly more complicated then what you actually need to
    do.

    Some general things. Don't overload the *SlickInputSystem implementations,
    unless you know exactly what you are doing. Those classes provide the
    possibility to attach own input receivers. But if you override the functions
    of those classes you might mess up the input forwarding to the Nifty-GUI. What
    is exactly what you did in this case. ;)

    The input systems are in short described here:
    https://sourceforge.net/apps/mediawiki/nifty-gui/index.php?title=Nifty_Slick_
    Renderer_(Nifty_1.3.1)#InputSystem

    What you have to actually do is to remove everything from the initGameAndGUI()
    function and just call inside there:

    initNifty(container, sbg);

    This will cause the GUI to be initialized with the default options. The input
    part is handled this way that the Input receiver that is implemented in every
    GameState (that gives you those mouse, key, controller*) functions receives
    all input events that are not handled by the GUI.

    And I think that is exactly what you want.

    For your rendering problem I think you missed to enter your Nifty-Screen. Best
    do this in enterState() be just calling getNifty().gotoScreen("id of your
    screen");

    For examples I converted all examples of Nifty to use the Slick renderer
    provided here: https://github.com/void256/nifty-gui/tree/1.3/nifty-examples-
    slick2d