update README

This commit is contained in:
printempw 2018-02-11 23:39:33 +08:00
parent d9fa502cab
commit b616ce8cf2
1 changed files with 24 additions and 15 deletions

View File

@ -28,28 +28,37 @@ Three.js powered Minecraft skin viewer.
capeUrl: "img/cape.png" capeUrl: "img/cape.png"
}); });
// change the skin and cape // Change the textures
// skinViewer.skinUrl = "img/skin.png"; skinViewer.skinUrl = "img/skin2.png";
// skinViewer.capeUrl = "img/cape.png"; skinViewer.capeUrl = "img/cape2.png";
// change the width and height // Resize the skin viewer
// skinViewer.width = 300; skinViewer.width = 300;
// skinViewer.height = 400; skinViewer.height = 400;
// enable the mouse control feature // Control objects with your mouse!
let control = new skinview3d.SkinControl(skinViewer); let control = new skinview3d.SkinControl(skinViewer);
control.rotation = true;
// disable the 'right click to play/pause' feature control.zoom = false;
// control.enableAnimationControl = false; control.pan = false;
skinViewer.animation = new skinview3d.CompositeAnimation(); skinViewer.animation = new skinview3d.CompositeAnimation();
// add an animation // Add an animation
let walk = skinViewer.animation.add(skinview3d.WalkAnimation); let walk = skinViewer.animation.add(skinview3d.WalkingAnimation);
// Add another animation
let rotate = skinViewer.animation.add(skinview3d.RotatingAnimation);
// Remove an animation, stop walking dude
walk.remove();
// And run for now!
let run = skinViewer.animation.add(skinview3d.RunningAnimation);
// set its speed and some others // Set the speed of an animation
walk.speed = 1.5; run.speed = 3;
// walk.paused = true; // Pause single animation
run.paused = true;
// Pause all animations!
skinViewer.animationPaused = true;
</script> </script>
``` ```