Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2006

Tip: Looking for answers? Try searching our database.

animation with static background image`

Thread view: 
azsx - 24 Nov 2006 08:24 GMT
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?
Oliver Wong - 24 Nov 2006 15:20 GMT
> 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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.