Built for the MinecraftCapes website.
Demo - https://minecraft-cape-creator.james090500.workers.dev
import MinecraftCapeCreator from 'minecraft-cape-creator'
this.minecraftCapeCreator: new MinecraftCapeCreator()You'll want to build a new cape after making any changes. The value returned is a base64 of the image. This can be displayed however you choose.
this.minecraftCapeCreator.buildCape().then(value => {
console.log(value);
})Provide a texture to show on the cape and elytra. The aspect ration will be squeezed to 1.6:1 so it's best to use a cropper tool like CropperJS.
changeImage() {
this.minecraftCapeCreator.setImage(image /* url | base64 | local */)
this.buildCape();
}Should there be a background cape/elytra? Note: This must follow the cape/elytra templates
showOnElytra(value) {
this.minecraftCapeCreator.setBackground(value /* url | base64 | local */)
this.buildCape();
}Should the image be on the elytra?
showOnElytra(value) {
this.minecraftCapeCreator.showOnElytra(value /* value */)
this.buildCape();
}You can either set a hex value #FF0000 or use setAutoColor which will calculate the colour based on the image.
changeColour() {
this.minecraftCapeCreator.setAutoColor()
this.minecraftCapeCreator.setColor(this.color)
this.buildCape()
}This will change the resolution of the cape. Min 1, Max 6. 1 = 64x32, 6 = 2048x1024. Obviously a larger scale will mean a clearer image.
changeScale() {
this.minecraftCapeCreator.setScale(this.scale)
this.buildCape()
}Pretty self expanitory
downloadCape() {
this.minecraftCapeCreator.downloadCape("Optional Name.png");
}