Slick Forums

Discuss the Slick 2D Library
It is currently Thu Apr 18, 2019 3:03 pm

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Tue Oct 25, 2011 12:24 am 
Offline
User avatar

Joined: Fri Oct 07, 2011 11:05 pm
Posts: 97
Location: France, Nantes
Hey guys, I found a new bug!

when trying to draw a rectangle with the width and the height of a path, it doesn't work until you actually get minX or maxX or minY or maxY!!!

check this out:
Code:
public void render(GameContainer container, Graphics g) throws SlickException {
      
      g.translate(0, 300);
      g.setColor(Color.white);
      g.draw(path);
      g.setColor(Color.green);
      g.draw(boundaries);
   }

   @Override
   public void init(GameContainer container) throws SlickException {
      reliefGen= new ReliefGenerator(800, 0.56f);
      path=(Path) reliefGen.generate(1)[0];
      System.out.print(path.getMinY());
      
      boundaries=new Rectangle(path.getX(),path.getY(),path.getWidth(),path.getHeight());
      
   }


This is working.
But, if I comment the System.out.print, not working anymore!!!

Strange eh?

EDIT: I think I found where it comes from:

there's no checkPoints() method in the getHeight(), getWidth() of the Shape class: could it be the reason why?

By the way, is Slick still developped?

_________________
"The Keeper is aware. The Keeper understands. The Keeper has seen the enemy."


Top
 Profile  
 
PostPosted: Sat May 12, 2012 5:08 am 
Offline
Slick Zombie

Joined: Sat Jan 27, 2007 7:10 pm
Posts: 1482
Added checkPoints() to getWidth/getHeight. Let me know if that fixes things.

Yes, Slick is still being developed -- some new developers are in place to keep it going. :)

EDIT: Bah, on a different computer than usual and running into push errors... Will update tomorrow.
EDIT2: Pushed.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 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