Slick Forums

Discuss the Slick 2D Library
It is currently Wed Oct 16, 2019 9:34 pm

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: g.draw(Shape, x, y)?
PostPosted: Wed Mar 09, 2011 7:04 pm 
Offline

Joined: Fri Mar 04, 2011 12:34 pm
Posts: 24
Well, there is no Graphics.draw(Shape, x, y) method. Why not? If theres no reason please add it :)

_________________
Rules of Optimization:
Rule 1: Don't do it.
Rule 2 (for experts only): Don't do it yet.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 09, 2011 7:59 pm 
Offline
Site Admin
User avatar

Joined: Thu Jan 01, 1970 12:00 am
Posts: 3143
g.translate(x,y);
g.draw(shape);

?

Kev


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 09, 2011 9:28 pm 
Offline

Joined: Fri Mar 04, 2011 12:34 pm
Posts: 24
yea sure, this works. but i dont necessarily want to translate the position of the shape back and forth. i.e. when there are multiple shapes in one context and you want to draw some of them somewhere else without pulling them out of that context.

_________________
Rules of Optimization:
Rule 1: Don't do it.
Rule 2 (for experts only): Don't do it yet.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 09, 2011 10:08 pm 
Offline
Site Admin
User avatar

Joined: Thu Jan 01, 1970 12:00 am
Posts: 3143
All the implementation would do would be:

g.translate(x,y);
g.draw(shape);
g.translate(-x,-y);

Kev


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 09, 2011 10:31 pm 
Offline

Joined: Fri Mar 04, 2011 12:34 pm
Posts: 24
hm :? well then leave it as it is

_________________
Rules of Optimization:
Rule 1: Don't do it.
Rule 2 (for experts only): Don't do it yet.


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 10 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:  
cron
Powered by phpBB® Forum Software © phpBB Group