fredsa / playn

Cross platform game library for N≥4 platforms
0 stars 1 forks source link

Feature request: add methods that return scale, x, and y #152

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
There are methods to setTranslation, setScale, setRotation,
but no getter methods to get the current values.
This is useful, e.g., for animations.

In contrast, there are methods to return depth, origin, etc.

Original issue reported on code.google.com by Yoav.Zibin@gmail.com on 23 Mar 2012 at 12:11

GoogleCodeExporter commented 9 years ago
You can always access these via Layer.tranform().[methods].

Duplicating the transform getters does make the API symmetrical and a tiny bit 
more intuitive, at the cost of bloat. There were practical reasons for having 
the setters so values can be checked. Personally, I don't think it's worth the 
extra code. Here's a patch if anyone wants to argue for it: 
http://code.google.com/r/pdr-playn/source/detail?r=fcaab7fb23939255b6e715a6193af
6ebdcfc28d9

Original comment by pdr@google.com on 31 May 2012 at 2:25

GoogleCodeExporter commented 9 years ago
I'm not opposed to adding these methods. It is sometimes a source of confusion, 
and it's not *that* many additional methods added to Layer. I would suggest 
that we name translateX and translateY, tx and ty. Otherwise you're only 
improving on the verbosity of layer.transform().tx() by two characters with 
layer.translationX().

Original comment by m...@samskivert.com on 31 May 2012 at 4:47