Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Animated Capes #128

Closed
wants to merge 11 commits into from
Closed

Conversation

james090500
Copy link
Contributor

@james090500 james090500 commented Jan 7, 2023

This supports animated capes using a sprite. Example here

Will probably need a manual merge and also needs this to be merged before hand
bs-community/skinview-utils#15

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
examples/index.html Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
rollup.config.js Outdated Show resolved Hide resolved
src/skinview-overrides.ts Outdated Show resolved Hide resolved
src/viewer.ts Outdated Show resolved Hide resolved
src/viewer.ts Outdated Show resolved Hide resolved
src/viewer.ts Outdated Show resolved Hide resolved
@james090500
Copy link
Contributor Author

Before merging this, skinview-utils needs to be merged and published so we can update the dependency in this package.

bs-community/skinview-utils#15

@james090500
Copy link
Contributor Author

I've also added an example

Copy link
Collaborator

@Hacksore Hacksore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just minor format issue and I can give a 👍 once you fix that.

rollup.config.js Outdated Show resolved Hide resolved
@james090500
Copy link
Contributor Author

I have added a fix to stop legacy cape (22x17) being detected as a sprite

Copy link
Collaborator

@Hacksore Hacksore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, needs review from @yushijinhun

@james090500
Copy link
Contributor Author

Any update on this?

this.lastFrameTime = currentTime

if(this.capeSource != null && this.totalFrames > 1) {
this.loadCape(this.capeSource, this.capeOptions)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calling loadCape() on each frame update would have a huge performance impact. I think it's better to load each frame into a individual canvas and just switch the canvas periodically.

@Hacksore Hacksore mentioned this pull request Nov 21, 2023
Closed
@Hacksore
Copy link
Collaborator

@james090500 has implemented this in this repo ❤️. Going to close this for now as it's a bit hard to get merged in.

https://github.com/minecraftcapes/minecraft-skin-viewer

@Hacksore Hacksore closed this Sep 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants