Skip to content

Commit

Permalink
Merge branch 'master' of github.com:bs-community/skinview3d into add-…
Browse files Browse the repository at this point in the history
…storybook
  • Loading branch information
Hacksore committed Jul 10, 2020
2 parents 01ff365 + 990deb1 commit e885a68
Show file tree
Hide file tree
Showing 9 changed files with 3,003 additions and 2,978 deletions.
1 change: 1 addition & 0 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ extends:
rules:
'@typescript-eslint/no-inferrable-types': off
'@typescript-eslint/interface-name-prefix': off
'@typescript-eslint/no-empty-interface': off
27 changes: 15 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,24 @@ Three.js powered Minecraft skin viewer.
```html
<div id="skin_container"></div>
<script>
let skinViewer = new skinview3d.SkinViewer({
domElement: document.getElementById("skin_container"),
width: 600,
height: 600,
skinUrl: "img/skin.png",
capeUrl: "img/cape.png"
let skinViewer = new skinview3d.SkinViewer(document.getElementById("skin_container"), {
width: 300,
height: 400,
skin: "img/skin.png"
});
// Change the textures
skinViewer.skinUrl = "img/skin2.png";
skinViewer.capeUrl = "img/cape2.png";
// Change viewer size
skinViewer.width = 600;
skinViewer.height = 800;
// Resize the skin viewer
skinViewer.width = 300;
skinViewer.height = 400;
// Load another skin
skinViewer.loadSkin("img/skin2.png");
// Load a cape
skinViewer.loadCape("img/cape.png");
// Unload(hide) the cape
skinViewer.loadCape(null);
// Control objects with your mouse!
let control = skinview3d.createOrbitControls(skinViewer);
Expand Down
40 changes: 40 additions & 0 deletions examples/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8">
<title>skinview3d</title>
<link href="https://fonts.googleapis.com/css?family=Archivo+Black" rel="stylesheet">
<style>
html,
body {
margin: 0;
padding: 0;
background-color: #1e1e1e;
}
</style>
</head>

<body>

<div id="skin_container"></div>

<script type="text/javascript" src="../bundles/skinview3d.bundle.js"></script>

<script>
let skinViewer = new skinview3d.SkinViewer(document.getElementById("skin_container"), {
width: 400,
height: 300,
skin: "./1_8_texturemap_redux.png"
});

let control = new skinview3d.createOrbitControls(skinViewer);
skinViewer.animations.add(skinview3d.WalkingAnimation);
skinViewer.animations.speed = 1.5;

</script>


</body>

</html>
Loading

0 comments on commit e885a68

Please sign in to comment.