Slick Forums

Discuss the Slick 2D Library
It is currently Mon May 20, 2013 8:29 am

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Wed Feb 15, 2012 3:54 pm 
Offline

Joined: Mon Jan 09, 2012 3:57 am
Posts: 4
Hi all,

So, Shapes!

I can set the points and get it to draw but I can't seem to get transformations working. I'm at work now so I can't post my code just now but basically I am creating a Polygon called shape then creating a Transform called t (I've tried translation and rotation transforms) then I call shape.transform(t)

Am I missing something? My shape won't budge.

Thanks in advance for any insight anyone might offer.
Peace!


Top
 Profile  
 
PostPosted: Wed Feb 15, 2012 8:01 pm 
Offline
Slick Zombie

Joined: Sat Jan 27, 2007 7:10 pm
Posts: 1467
The transform method returns a new shape with the transformed points.

Code:
newShape = shape.transform(t);


Top
 Profile  
 
PostPosted: Sat Feb 18, 2012 1:26 am 
Offline

Joined: Mon Jan 09, 2012 3:57 am
Posts: 4
Thanks, yeah I saw that in the documentation but I'm still not sure how to use it properly.

So I was going

shape = shape.transform(t);

thinking that would simply assign the new shape to my original object, but that doesn't seem to happen. I haven't had any time to play with my code since I posted the question, does anyone know where to find good examples of working with shapes?

Thanks again


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

All times are UTC


Who is online

Users browsing this forum: Yuri6037 and 2 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