Thank you very much exactly what I was looking for.

On Tuesday, November 21, 2017 at 3:43:45 AM UTC, Claudio Canepa wrote:
>
> Oh, sorry, I misread as "want to manually set which picture in the gif 
> will be shown when pressing a key" while you want multiple gifs, and jump 
> to one to the other.
> One possibility it is to join all the gifs in only one gif and proceed as 
> before.
>
> Else, for sepparate gifs you should look at the pyglet.sprite.Sprite code, 
> in particular to the __init__ and _animate methods and see how to 
> manipulate the sprite animation state to switch between gifs.
>    
>
> On Tue, Nov 21, 2017 at 12:22 AM, claudio canepa <[email protected] 
> <javascript:>> wrote:
>
>> Yes. The sprite.image attribute controls which image will be shown.
>>
>> So the issue would be how to access each picture into the .GIF
>>
>> I modified the cocos' s example test/test_animation.py first to explore 
>> the GIF and then to change the picture at each SPACE key release.
>>
>> Attached as test_animation_2.py, put in the test/ directory so the gif 
>> can be found.
>>
>>
>>
>>
>>
>> On Mon, Nov 20, 2017 at 6:52 PM, FreshManGaming <[email protected] 
>> <javascript:>> wrote:
>>
>>> Hi all,
>>>
>>> I'm trying to change an animated GIF in real time to another animated 
>>> GIF, e.g. from an idle state to a running state depending on a key-press. 
>>>
>>> So far I have managed to load in the idle animated GIF but I am 
>>> struggling to replace the idle GIF to the running GIF,
>>>
>>> I have looked into using Pyglet's Animation class however whenever I use 
>>> from_image_sequence 
>>> the program just crashes. 
>>>
>>> Are there any ways to change a sprite represented by a GIF in real time 
>>> with another GIF temporarily depending on a key-press?
>>>
>>> Thank you.
>>>
>>> -- 
>>> 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] <javascript:>.
>>> To post to this group, send email to [email protected] 
>>> <javascript:>.
>>> Visit this group at https://groups.google.com/group/cocos-discuss.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>

-- 
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 https://groups.google.com/group/cocos-discuss.
For more options, visit https://groups.google.com/d/optout.

Reply via email to