Difference between revisions of "Animation"

From Progzoo
Jump to: navigation, search
(Moving block)
(Moving block)
Line 33: Line 33:
 
==Moving block==
 
==Moving block==
 
<question copyFile="classes.jar" imgOut='anim.gif'
 
<question copyFile="classes.jar" imgOut='anim.gif'
  frames='20' width='150' height='100' className="Anim"
+
  frames='120' width='150' height='100' className="Anim"
 
  classpath="classes.jar">
 
  classpath="classes.jar">
 
<prog>
 
<prog>
 
static void drawFrame(Graphics2D g, int frame){
 
static void drawFrame(Graphics2D g, int frame){
 
   g.setColor(Color.red);
 
   g.setColor(Color.red);
   g.fillRect(0,0,300,200);
+
   g.fillRect(0,0,150,100);
 
   g.setColor(Color.yellow);
 
   g.setColor(Color.yellow);
   g.fillRect(50,10*frame,100,20);
+
   g.fillRect(50,5*frame-20,50,20);
 
}
 
}
 +
  
 
</prog>
 
</prog>

Revision as of 00:38, 21 November 2008

The animations here rely on Gif89Encoder available from http://jmge.net/java/gifenc/ developed by JMG Elliot.

Moving block


[Font] [Default] [Show] [Resize] [History] [Profile]

Shooting Star


[Font] [Default] [Show] [Resize] [History] [Profile]