Slick Forums

Discuss the Slick 2D Library
It is currently Tue Sep 19, 2017 3:06 pm

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Mon Jan 30, 2012 1:49 am 
Offline
Slick Zombie

Joined: Sat Jan 27, 2007 7:10 pm
Posts: 1482
AngelCodeFont.getWidth adds the width of the last character instead of its xadvance; if the last character is a space (or other character with no width), the resulting text width will be incorrect.
Code:
         if (i < n - 1) {
            width += charDef.xadvance;
         } else {
            width += charDef.width;
         }




You can test with the default font:
Code:
        Font f = container.getDefaultFont();
        System.out.println(f.getWidth("i") < f.getWidth("i "));


Top
 Profile  
 
PostPosted: Tue Jan 29, 2013 8:14 pm 
Offline

Joined: Tue Jan 29, 2013 5:35 pm
Posts: 2
Ok, I realize that Im not using the latest version of Slick. I have, yes, the latest source, but I cant get the latest Slick.jar file. I know that there must be some non-magic way to compile the entire proyect and get the simple Slick.jar but Im not sure how to do it.

In order to use Slick, I usually simply add the Slick.jar file into a "lib" folder of my project game. But I cant get an updated Slick.jar file.

Please, I really need a map? Im kinda lost with the dev branch and all that, just looking for the latest version of the Slick.jar file...

Thank you


Top
 Profile  
 
PostPosted: Thu Jan 31, 2013 7:57 am 
Offline
Slick Zombie

Joined: Sat Jan 27, 2007 7:10 pm
Posts: 1482
See the global forum announcement for details.

The latest Slick.jar file is on the slick2d.org website. You'll also need the latest LWJGL binaries and natives from their website. If that JAR isn't recent enough to include the fix, then you are stuck building from development branch -- which really should only take about 10 minutes if you follow the guide.


Top
 Profile  
 
PostPosted: Fri Jun 05, 2015 9:24 am 
Offline

Joined: Fri Jun 05, 2015 9:17 am
Posts: 1
First you need to check Mouse.getEventButton >= 0 and only then check the Mouse.getEventButtonState.

And always upgrade to the latest LWJGL version.


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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