Slick Forums

Discuss the Slick 2D Library
It is currently Sun May 26, 2013 12:12 am

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Tue Oct 09, 2012 12:34 pm 
Offline

Joined: Mon Jan 23, 2012 9:14 pm
Posts: 71
Location: France
hi,

I'm trying to use Nifty GUI for my slick project.

However, when I try to import a font via this XML :
Code:
<text font="res/font/test.ttf"


I get an exception when nifty is parsing the XML

Code:
Exception in thread "main" java.lang.NoSuchMethodError: org.newdawn.slick.Font.getWidth(Ljava/lang/String;)I
   at de.lessvoid.nifty.slick2d.render.font.AbstractSlickRenderFont.getWidth(AbstractSlickRenderFont.java:80)
   at de.lessvoid.nifty.elements.render.TextRenderer.initText(TextRenderer.java:166)
   at de.lessvoid.nifty.elements.render.TextRenderer.setText(TextRenderer.java:136)
   at de.lessvoid.nifty.loaderv2.types.apply.ApplyRenderText.apply(ApplyRenderText.java:28)
   at de.lessvoid.nifty.elements.Element.initializeFromAttributes(Element.java:433)
   at de.lessvoid.nifty.loaderv2.types.ElementType.applyAttributes(ElementType.java:218)
   at de.lessvoid.nifty.loaderv2.types.ElementType.applyStandard(ElementType.java:172)
   at de.lessvoid.nifty.loaderv2.types.ElementType.create(ElementType.java:144)
   at de.lessvoid.nifty.loaderv2.types.ElementType.applyChildren(ElementType.java:251)
   at de.lessvoid.nifty.loaderv2.types.ElementType.applyStandard(ElementType.java:175)
   at de.lessvoid.nifty.loaderv2.types.ElementType.create(ElementType.java:144)
   at de.lessvoid.nifty.loaderv2.types.ElementType.applyChildren(ElementType.java:251)
   at de.lessvoid.nifty.loaderv2.types.ElementType.applyStandard(ElementType.java:175)
   at de.lessvoid.nifty.loaderv2.types.ElementType.create(ElementType.java:144)
   at de.lessvoid.nifty.loaderv2.types.ScreenType.create(ScreenType.java:80)
   at de.lessvoid.nifty.loaderv2.types.NiftyType.create(NiftyType.java:137)
   at de.lessvoid.nifty.Nifty.loadFromFile(Nifty.java:569)
   at de.lessvoid.nifty.Nifty.fromXml(Nifty.java:454)
   at gui.mainmenu.GUITest.initGameAndGUI(GUITest.java:94)
   at de.lessvoid.nifty.slick2d.NiftyOverlayBasicGameState.init(NiftyOverlayBasicGameState.java:124)
   at org.newdawn.slick.state.StateBasedGame.init(StateBasedGame.java:177)
   at org.newdawn.slick.AppGameContainer.setup(AppGameContainer.java:433)
   at org.newdawn.slick.AppGameContainer.start(AppGameContainer.java:357)
   at launcher.Launcher.launchGame(Launcher.java:157)
   at launcher.Launcher.main(Launcher.java:66)


I guess it's trying to use org.newdawn.slick.Font.getWidth, which can't be found apparently
I use a nightly from Slick (not the most recent one), could that be the problem ? Or is it an issue from nifty ?

I'm using nifty-1.3.2.jar and nifty-slick-renderer-1.3.2.jar

I haven't found any similar problems

Thanks


Top
 Profile  
 
PostPosted: Tue Oct 09, 2012 3:05 pm 
Offline
Slick Zombie

Joined: Sat Jan 27, 2007 7:10 pm
Posts: 1469
Slick recently switched to using CharSequence for fonts. So your nifty or slick binaries do not match. You probably need to re-build Nifty against the latest Slick version.


Top
 Profile  
 
PostPosted: Tue Oct 09, 2012 5:21 pm 
Offline

Joined: Mon Jan 23, 2012 9:14 pm
Posts: 71
Location: France
Alright, thanks

I tried with the very last versions of slick and nifty gui, same problem happened.

Ahh I guess I'll just reretry to learn TWL, at least I could display a button there lol


Top
 Profile  
 
PostPosted: Fri Oct 12, 2012 8:23 am 
Offline
Regular

Joined: Sun Oct 30, 2011 4:47 pm
Posts: 184
Location: Mittweida, Saxony, Germany
Nifty-GUI is compiled with the last maven release of Slick. As long as there is no new release of Slick, this problem will persist.

Nitram

_________________
http://illarion.org


Top
 Profile  
 
PostPosted: Sun Mar 03, 2013 10:00 pm 
Offline

Joined: Sun Mar 03, 2013 9:49 pm
Posts: 1
Hi,

Sorry for digging up an old post but after lots of searching, it was the only one corresponding to the problem I'm having.

I'm currently using the latest version of Slick (downloaded on web site) and Nifty GUI 1.3.2 to make a game.
I'm able to build interfaces with XML without any problem.

But, whenever I try to insert a control/element that use font (i.e. <text></text>...) in my XML file, I receive the exact same error as mentionned by the OP.

I was wondering if the problem was still persisting or if someone had the same problem and found a workaround? If not, should I consider moving to TWL for GUI instead?

Thanks


Top
 Profile  
 
PostPosted: Mon Mar 04, 2013 6:08 pm 
Offline
User avatar

Joined: Thu Feb 21, 2013 1:16 pm
Posts: 29
For using Nifty GUI with Slick you have to use an older Slick build, which you can find here: http://t.co/FUAEPHIU
I got on well that way (so far^^), you only have to take care that some minor things are different. But I haven't registered any major issue yet that would break development.

_________________
Thanks beforehand! (Optional addition ;-) )
Greetings,

HariboTer


Top
 Profile  
 
PostPosted: Sun May 05, 2013 6:42 pm 
Offline

Joined: Sun May 05, 2013 6:36 pm
Posts: 1
So... I recently started a project in Slick2D with Nifty for GUI but struck the same problem as the author and are now looking for a GUI API that works well with slick2d.
From what i understand wont Nifty be compatible with slick anymore so what do you ppl recommend instead or should i build my own gui handler?


Top
 Profile  
 
PostPosted: Fri May 10, 2013 10:55 pm 
Offline
User avatar

Joined: Thu Feb 21, 2013 1:16 pm
Posts: 29
mortinious wrote:
So... I recently started a project in Slick2D with Nifty for GUI but struck the same problem as the author and are now looking for a GUI API that works well with slick2d.
From what i understand wont Nifty be compatible with slick anymore so what do you ppl recommend instead or should i build my own gui handler?


HariboTer wrote:
For using Nifty GUI with Slick you have to use an older Slick build, which you can find here: http://t.co/FUAEPHIU
I got on well that way (so far^^), you only have to take care that some minor things are different. But I haven't registered any major issue yet that would break development.


Just this should solve your problem with Nifty (which is a really flexible and powerful GUI library). Reading is a mighty gift that you should use well, but certainly not too spare.

_________________
Thanks beforehand! (Optional addition ;-) )
Greetings,

HariboTer


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group