python-elgato-streamdeck icon indicating copy to clipboard operation
python-elgato-streamdeck copied to clipboard

Include basic visual effects functions in examples

Open PFython opened this issue 5 years ago • 1 comments

Apologies - my first ever attempt at contributing to code using a GIT pull request. Not sure which project file these would best be suited to, but I thought it might be useful/fun to have a library of visual effects which can grow over time, perhaps just in your example scripts. I've tested these by simply inserting them into the __ main __ = "__ name __" block of example_tileimage.py for example.

PFython avatar Sep 30 '19 23:09 PFython

Neat idea - and welcome to Git(hub)!

I think this might be best suited to either an example in the repo and documentation, or if there's enough general interest we can make it part of the internals as an optional utility class.

To make things non-blocking, try a Threading.Timer. See this area in the animated gif example for inspiration on how to trigger something every frame interval. The most sensible way to design this would be to make a function that can accept a speed (time interval) and an animation function, which it calls every 1/Nth of a second until the animation function returns False to signify it's complete.

abcminiuser avatar Oct 08 '19 10:10 abcminiuser