Ok, sorry for being unclear (as if being a noob wasn't enough) !
What I meant, was that sprite._texture or sprite.image.texture were the 
same thing.

your code works perfectly, adding those line definitely works:
self.sprite = Sprite('grossini.png')
self.textures.append(self.sprite._texture)

What I don't understand is why this does not work :
self.sprite = Sprite('grossini.png')
self.textures.append(self.sprite._texture)#nothing changed yet
self.sprite2 = Sprite('grossinis_sister2.png')
self.textures.append(self.sprite2._texture)#just adding another sprite's 
texture

this last code raises "pyglet.gl.lib.GLException: invalid operation" when I 
press Up arrow enough to select the sprite2 texture.

It is currently a batch of sprites that I meant to darken, but this was 
before I knew of another way to draw stuff to screen. It's more like tiles 
that I'm drawing, so a simple VertexList would probably work, without the 
overhead.

Once again Claudio, many many thanks for your help

Le mercredi 13 novembre 2013 22:39:18 UTC+1, Claudio Canepa a écrit :
>
>
>
>
> On Wed, Nov 13, 2013 at 6:03 PM, Nitneroc <[email protected]<javascript:>
> > wrote:
>
>> I think my way of accessing the texture id worked ok (
>> sprite.image.texture.id instead of sprite._texture.id)
>>
>
> ??? 
>
> Modifying test_shader_examples.py by adding near the end of 
> TestLayer.__init__
>
>       self.sprite = Sprite('grossini.png')
>       self.textures.append(self.sprite._texture)
>
> you can switch to the grossini visual with the up-down arrow, it shows as 
> it should, and switching shaders with left - right arrows works.
>
> If I change self.sprite._texture to self.sprite.image.texture.id , I get 
> a traceback:
> ...
> File "..\cocos\cocosnode.py", line 676, in visit
>     self.draw()
> File "test_shader_examples.py", line 70, in draw
>     glBindTexture(GL_TEXTURE_2D, self.texture.id)
> AttributeError: 'long' object has no attribute 'id' 
>
>
> , but the rest is way over my head. 
>> Thanks again for your help and pointers, I'll have a look at all this 
>> stuff
>>
>
> Take it easy, write simple code to exercise what you see in tutorials, 
> modify slightly the code in tutorials to grasp the domain.
>
> BTW, it is a batch of sprites what you want to darken ?
>  
>

-- 
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.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to