Skip to content

feat(2d): add animated image (animated WebP) playback support - #229

Open
Tianze-Chen wants to merge 1 commit into
cocos:v4.0.0from
Tianze-Chen:feature/animated-image
Open

feat(2d): add animated image (animated WebP) playback support#229
Tianze-Chen wants to merge 1 commit into
cocos:v4.0.0from
Tianze-Chen:feature/animated-image

Conversation

@Tianze-Chen

Copy link
Copy Markdown
Contributor

Add a layered animated-image feature: a low-level AnimatedImagePlayer, an AnimatedImage component, and a pal/image-decoder PAL with per-platform backends. The web backend uses the native WebCodecs ImageDecoder with a bundled libwebp WASM fallback; other platforms fall back to WASM.

The AnimatedImage component plays on the sibling Sprite and accepts three sources: an ImageAsset (a webp imported the default way — recommended and default), a remote URL, or a local BufferAsset. Only the field relevant to the selected sourceType is shown in the inspector.

Also register the IMAGE_DECODER system-info feature, wire the pal mapping and animated-image module in cc.config.json, add the Feature Cropping entry and i18n, and include a runtime demo under docs/examples.

Re: #

Changelog


Continuous Integration

This pull request:

  • needs automatic test cases check.

    Manual trigger with @cocos-robot run test cases afterward.

  • does not change any runtime related code or build configuration

    If any reviewer thinks the CI checks are needed, please uncheck this option, then close and reopen the issue.


Compatibility Check

This pull request:

  • changes public API, and have ensured backward compatibility with deprecated features.
  • affects platform compatibility, e.g. system version, browser version, platform sdk version, platform toolchain, language version, hardware compatibility etc.
  • affects file structure of the build package or build configuration which requires user project upgrade.
  • introduces breaking changes, please list all changes, affected features and the scope of violation.

Add a layered animated-image feature: a low-level AnimatedImagePlayer, an
AnimatedImage component, and a pal/image-decoder PAL with per-platform
backends. The web backend uses the native WebCodecs ImageDecoder with a
bundled libwebp WASM fallback; other platforms fall back to WASM.

The AnimatedImage component plays on the sibling Sprite and accepts three
sources: an ImageAsset (a webp imported the default way — recommended and
default), a remote URL, or a local BufferAsset. Only the field relevant to
the selected sourceType is shown in the inspector.

Also register the IMAGE_DECODER system-info feature, wire the pal mapping
and animated-image module in cc.config.json, add the Feature Cropping entry
and i18n, and include a runtime demo under docs/examples.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@star-e star-e added the investigation Investigate the impact on the code base label Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

investigation Investigate the impact on the code base

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants