On Tue, Jun 9, 2009 at 2:37 AM, Adam Wiggins<[email protected]> wrote: > (I wasn't sure where to send this, since there doesn't seem to be a > development mailing list and the issue tracker seems to be only for > bugs.) > > I'm working on a game that uses additive blending. I've seen a number > of people ask for this feature (both for the original Python library > and the iPhone version) so I thought I'd take a stab at it. The > attached patch adds an attribute on Sprite called blend_mode, which > currently can be set to either Sprite.BLEND_STANDARD (the usual alpha > blending) or Sprite.BLEND_ADDITIVE. Like so: > > my_sprite = Sprite(my_image, blend_mode=Sprite.BLEND_ADDITIVE) > > Particles use additive blending by default, so maybe this would be > something that would make sense to abstract somewhere that could be > shared by both? In any case, a patch to implement the above > functionality on Sprite, and a demo_blending.py that shows the > grossini.png sprite in both standard and additive blending mode, is > attached. >
Hello Adam, thanks for your patch. pyglet sprites already support blending modes and the usage of groups to make the rendering when using batch nodes faster. Shoudnt we integrate with that instead of writing something new? With this patch, the blending mode wont work on batches. Lucio. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "cocos2d discuss" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cocos-discuss?hl=en -~----------~----~----~----~------~----~------~--~---
