Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] FPS control in animation?


Not sure if this is what you are looking for, but here is an example of using an animated GIF in SWT:
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet141.java?rev=HEAD&content-type=text/vnd.viewcvs-markup
You need to have (or create) some animated gif's to run this snippet.
To change the frames per second, simply modify the "delayTime" field in the ImageData for the animated gif.
Hope this helps,
Carolyn



<Yu.You@xxxxxxxxx>
Sent by: platform-swt-dev-admin@xxxxxxxxxxx

09/09/2004 03:44 AM

Please respond to
platform-swt-dev

To
<platform-swt-dev@xxxxxxxxxxx>
cc
Subject
[platform-swt-dev] FPS control in animation?





Hi,

When displaying multiple animated images (e.g. sprites) on the screen, how can I precisely control the fps of each sprite to have them run in an individual way? e.g. I want to set a gear sprite to spin faster but the same gear image runs slower, e.g.

// I have a Sprite class
fps1 = 10;
Sprite gear1 = new Sprite(gearImageData, fps1);
fps2 = 5;
Sprite gear1 = new Sprite(gearImageData, fps2);

Is there any similiar engine available?

Thanks,

Regards,
Yu

_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/platform-swt-dev


Back to the top