playcanvas / playcanvas/engine
Add API to assign material to a sprite
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 16.8k
- Forks
- 2k
- Avg merge
- 4h 32m
- Merged PRs (30d)
- 222
Description
Forum: https://forum.playcanvas.com/t/animated-sprite-with-custom-shader-material/26060/
Currently it isn't possible to assign a custom material to an animated sprite as in updateFrame, it has a check where if it's not using the default sprite material, it changes it back to using it making overriding it impossible without monkey patching.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/framework/components/sprite/component.js at updateFrame, which currently restores the default sprite material when a custom material is assigned. Define the API needed to assign a material to an animated sprite, then verify that frame updates preserve the custom material instead of replacing it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- game-dev
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100