Animated MinecraftCapes Capes are appearing as a tilesheet
h3oCharles opened this issue · 2 comments
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
I uuh buy access to animated capes on minecraftcapes, upload an animated cape, and uuh you get what I have on the screenshot
Expected behavior
A clear and concise description of what you expected to happen.
an animated cape (duh?)
Screenshots
If applicable, add screenshots to help explain your problem.
Context (please complete the following information):
- Minecraft version: 1.17.1
- Capes version: 1.2.1
- Mod list: screenshot below
- Server: Singleplayer
Additional context
Add any other context about the problem here.
Ooops, I might have never implemented animated capes. I will work on it later™
Just in case it helps, the general rule of thumb is... 1 frame every 100 milliseconds.
And you can split the cape up with....
Int2ObjectMap<NativeImage> animatedCape = new Int2ObjectOpenHashMap<>();
int totalFrames = capeImage.getHeight() / (capeImage.getWidth() / 2);
for(int currentFrame = 0; currentFrame < totalFrames; currentFrame++) {
NativeImage frame = new NativeImage(capeImage.getWidth(), capeImage.getWidth() / 2, true);
for (int x = 0; x < frame.getWidth(); x++) {
for (int y = 0; y < frame.getHeight(); y++) {
frame.setPixelRGBA(x, y, capeImage.getPixelRGBA(x, y + (currentFrame * (capeImage.getWidth() / 2))));
}
}
animatedCape.put(currentFrame, frame);
}