By mjrb4 - uploaded on 2008-9-10 3622 views (203 in the last 7 days) 1 vote (0 in the last 7 days)
Tags: demo with-source animation gif
Similar to mik's AnimatedActor demo, but this time you can just create an animated actor by calling setImage() and providing GifActor with an animated GIF file.
Speeed is no longer solely dependant on the speed of the slider. The animation will always "try" to run at the speed specified in the gif file. So if it's sped up to faster than this, it will still run at the same speed.
If it's slower, then it will just run as fast as it can - it can only update its image as fast as the scenario is running.
UPDATE:
- GifActor now also looks in the images folder for the GIF image (as well as the main folder previously)
- If the image can't be found a better error message is given (before it was just a NPE, now it states it can't find the image.)
- Changed setSimulationSpeed to setSpeed in the source to update it to the "new" API (though it's not that new now!)
If you just want the source of GifActor, see the URL.
Visit the web page for this scenario.
Open the scenario in Greenfoot.
Download the source for this scenario.
Some people who like this scenario: freddy
This scenario is a member of the following collections: Reusable actors & support classes
Report this scenario as broken or inappropriate.
The Greenfoot Network: Greenfoot.org Greenfoot Gallery Greenfoot-Discuss
A new version of this scenario was uploaded on Sat Sep 13 14:44:42 UTC 2008
mjrb4 writes (on 2008-9-13):
Few improvements:
- Everything is now in the GifActor class so you don't need to worry about adding the other class in seperately.
- Changed the animation (though that's not really an update!)
- Code cleaner - more comments so you should be able to understand what's going on better
- Pause and resume methods added - press "p" to pause and "r" to resume in this example
- getImages() method added, this will return a list of all the greenfoot images in use.
freddy writes (on 2008-10-22):
it's real cool and it's confusing!
LordMindless writes (on 2010-2-14):
Cool. In wich Dimension is this? looks more than 4D.
MathManiac writes (on 2010-3-14):
3-D
gamemaster123 writes (on 2010-7-6):
hey i like the scenario but you might want to lock the scenario before you export it or people can mess with it and decompile it to get your code
Andres writes (on 2010-7-6):
thats the point... he put this here so people can use his code...
and locking the scenario would also lock the speed slider.
mjrb4 writes (on 2010-7-6):
As pointed out above the source is deliberately there so people can have a play around :-)
A new version of this scenario was uploaded on Thu Aug 19 11:22:01 UTC 2010
A new version of this scenario was uploaded on Thu Aug 19 11:26:25 UTC 2010
See all comments for this scenario.
If you want to leave a comment on this scenario, you must first log in.