Animated sprites on canvas [Eugene Dakin's Program the Canvas Control book]

I am using Eugene Dakin’s book I Wish I Knew How To… Program the Canvas Control With Xojo Desktop 3 and examples and they are very helpful.
I want to spawn animated sprite objects on a canvas.
The book has an animated sprite example, and also a spawning still/picture objects example.
Is it possible to create animated sprite objects in the same manner as the create still image objects example.

Hello Jon-Paul,

Here are comments from our private conversation. This is to let the community know that this is being looked at. :slight_smile:

Yes, animation can be spawned by using objects in the canvas. The rough steps are to convert the Artemis animation example, and substitute it into the bicycle example.

Unfortunately, I am on the road and have limited time to create an example. It might take me some time to create the example. When I am back at my development computer. I might have an example created by the weekend?

Let me know if that is okay for you.

Warm regards,

1 Like

Hi Jon-Paul,

Here is the Example zip file that can be downloaded from mediafire with a Xojo project and some graphics.
ExampleAnimation.zip

The running example is shown below.
ExampleAnim

This is a modified Example11-5 from the canvas book and here are what was changed:

  1. Added 6 pictures instead of a spite sheet
  2. CreateAnObject with SpriteSheet instead of Bicycle or Garbage can
  3. Added a timer which fires the Canvas every 150 milliseconds
  4. in the ShowAllObjects method, the objects increment with each SpreadSheet picture (1, then 2, then 3, etc)

Happy to help

The example has been updated to prevent the rapid updating when dragging the object.

SpriteRev2

Code in ExampleAnimation-Rev2.zip can be downloaded here:
ExampleAnimation-Rev2.zip

Thank you!