On 27/11/2009, at 10:36 AM, flx wrote:
> Try running the above example (fire.png is included in cocos
> distribution)

I didn't have a chance to do so this morning (was on mobile) but have done so 
now. The code runs unreasonably slowly. The cause is that the default cocos 
Sprite is *capable* of being really fast using batches, but doesn't *use* that 
capability by default. To make it faster use something like the following in 
your code:


from cocos import batch

class TLayer(cocos.layer.Layer):
   is_event_handler = True
   def __init__(self):
       cocos.layer.Layer.__init__(self)
       b = batch.BatchNode()
       self.add(b)
       for i in range(1000):
           b.add(cocos.sprite.Sprite('fire.png', (100 * i, 100 * i)))


--

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.


Reply via email to