how to use animated gif ?

This is the place for queries about ThorPy issues : installation, coding, ...
buffalo
Posts: 44
Joined: Thu Feb 25, 2016 10:34 am

how to use animated gif ?

Postby buffalo » Mon Jun 12, 2017 7:04 pm

I am using an animated gif in the background, but it's frozen at his first frame.

ThorPy
Site Admin
Posts: 21
Joined: Wed May 13, 2015 9:44 pm

Re: how to use animated gif ?

Postby ThorPy » Wed Jun 14, 2017 6:14 pm

Here is a code that should store an animated gif into an element of type AnimatedGif.
You can try it (I just added this kind of element in Thorpy 1.5.9):

Code: Select all

import thorpy, pygame

application = thorpy.Application((500,500), "Launching alerts")

my_gif = thorpy.AnimatedGif.make("anim.gif", colorkey=None, low=2)
#you can play with the value of low in order to decrease the speed of the animation.
#(also, you can play with the FPS of the menu)

background = thorpy.Background.make(image=thorpy.style.EXAMPLE_IMG,
                                    elements=[my_gif])
thorpy.store(background)

menu = thorpy.Menu(background, FPS=45)
menu.play()

application.quit()



Return to “General ThorPy help”

Who is online

Users browsing this forum: No registered users and 1 guest