Hey, Claudio, thank you for your answer. On Friday, May 24, 2013 7:25:41 PM UTC-3, Claudio Canepa wrote: > > > On Fri, May 24, 2013 at 6:37 PM, Gerardo Marset > <[email protected]<javascript:> > > wrote: > >> Is there a way to change the verical and horizontal scaling of a sprite >> (or node or whatever) independently of each other? > > > Not a direct one. > > >> Really I just want to mirror a sprite. I know I can do that by passing >> flip_x as True when loading the sprite but that seems like a lot of work to >> do something so simple. > > > If flip_x is enough for your needs, then it is the best option: you pay a > bit of overhead at loading time and nothing at each render time. >
Alright, well, I guess I'll do that. At least for now. You can change a Sprite's rotation, alpha and color but not its vertical >> and horizontal scaling independently? Why is that? >> > > > It is an operation rarely needed. > > The additional parameter would need to be used in > cocos.sprite.Sprite._update_position, and as a result that method would be > a little slower for *any* sprite, not only the ones with scale_x != scale_y > > cocos (or pyglet) sprites are slow in terms of openGL performance > > So, there is a tradeof : make easy a rarely required feature versus make > the general case slower. > > So far the feature was not seen as justifying the cost. > Is the cost really that big, though? I just checked cocos.sprite.Sprite._update_position, and confirmed it would work just fine if scale_x != scale_y with minimum changes... Here, look: http://pastebin.com/NnSk8GTv I didn't test much, but it seems to work just fine. -- You received this message because you are subscribed to the Google Groups "cocos2d discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/cocos-discuss?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
