Hi. Can you give me an example of drawing some simple animation on a
static image? Let's say that a red circle has to move over the
background image, can you help? Do I need to do this with threads?
> Hi. Can you give me an example of drawing some simple animation on a
> static image? Let's say that a red circle has to move over the
> background image, can you help?
You usually a completely opaque background, so that the previous frame
has no effect on the appearance of the next frame. Draw the background,
which effectively wipes out all trace of the previous frame, and then draw
your red circle. Drawing from back-to-front like this is known as "Painters
Algorithm".
> Do I need to do this with threads?
Whenever you use a GUI like AWT or Swing, they will use threads behind
the scenes. However, you do not need to explicitly create any threads over
the ones that AWT/Swing creates for you, if all you want to do is draw some
animations.
- Oliver
azsx - 24 Nov 2006 16:14 GMT
> You usually a completely opaque background, so that the previous frame
> has no effect on the appearance of the next frame. Draw the background,
> which effectively wipes out all trace of the previous frame, and then draw
> your red circle. Drawing from back-to-front like this is known as "Painters
> Algorithm".
please give me an example or some links...
My problemm is like this: using threads simulate the rotation of
planets arround Sun. All animation is done over some background image
that the user can change... Animation should have play/pause option.
Can you give me some ideas?
Oliver Wong - 24 Nov 2006 16:45 GMT
>> You usually a completely opaque background, so that the previous frame
>> has no effect on the appearance of the next frame. Draw the background,
[quoted text clipped - 9 lines]
> that the user can change... Animation should have play/pause option.
> Can you give me some ideas?
When I google for "java animation example", I get
http://kawigi.yajags.com/animation/
- Oliver