Microsoft MakeCode

Animation docs

Are there docs for the new animation API? I can find tutorials and docs for the older api, called “legacy”, but not the new (current?) api. I’d prefer to use the new api since it provides the animated sprite editor.

In particular I want to change animation loops when my character changes direction or moves, similar to the classic Adafruit example.

Thanks.

2 Likes

Yes, if you right click on the block and click “help” it will open up a reference page in the side docs. (Ideally we have those for all blocks, but sometimes a few slip through as it’s a manual process.

)

I will note though that I have personally had better luck using the legacy apis when switching between animation states like that (walking left to walking right, etc), as the kind helps keep state within the animations themselves; that may be because I’ve used those ones more though, and can be accomplished with an extra variable keeping track either way.

thanks. Yeah, I don’t see anything equivalent to activate animation from the legacy APIs. Too bad I can’t use the sprite anim editor w/ the old apis. Are the new ones still under active development?

I personally think there could be a coat of paint on them, ideally w/ the two being made interoperable (e.g. letting the create animation block take an optional parameter of the frames, so the first block is the simple case / for one off animations and the others are for when you want more detailed control).

I’m not sure I would say active development, but making apis more usable in general is being thought about for sure / if you have a particular ideal set of APIs / specific blocks you need for the animation category I’d love to see them

I’d like to see a way to pause an animation and to switch between animation sets. It will be common to do things like

  • animate the player moving left, then switch to right or up or down
  • switch animations when jumping
  • make a slow animation like a lamp that only flickers every few seconds
  • make a tileset with animated tiles, like a fireplace.
1 Like

There is a stop animation block

In case folks are looking, recently @riknoll has also been working on an extension to make character animations easier that you can find here https://github.com/riknoll/character-animations!

1 Like

1 Like