Skip to content

Commit

Permalink
Remove global assigns to THREE (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
sritchie authored Feb 17, 2022
1 parent efff476 commit 4ac35fd
Show file tree
Hide file tree
Showing 44 changed files with 5,188 additions and 645 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ module.exports = {
},
rules: {
"no-unused-vars": [1, { argsIgnorePattern: "^_" }],
"no-multi-str": 1
},
};
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Add `build/threestrap.js` to your Three.js:
Get a threestrap context:

```javascript
var three = new THREE.Bootstrap();
var three = new Threestrap.Bootstrap();
```

This will create a full-page Three.js WebGL canvas, initialize the scene and
Expand Down Expand Up @@ -92,25 +92,25 @@ Shorthands:

```javascript
// Core only
var three = new THREE.Bootstrap();
var three = new Threestrap.Bootstrap();

// Pass in list of plugins
var three = new THREE.Bootstrap("core", "stats");
var three = new THREE.Bootstrap(["core", "stats"]);
var three = new Threestrap.Bootstrap("core", "stats");
var three = new Threestrap.Bootstrap(["core", "stats"]);

// Insert into specific element
var three = new THREE.Bootstrap(element);
var three = new THREE.Bootstrap(element, "core", "stats");
var three = new THREE.Bootstrap(element, ["core", "stats"]);
var three = new Threestrap.Bootstrap(element);
var three = new Threestrap.Bootstrap(element, "core", "stats");
var three = new Threestrap.Bootstrap(element, ["core", "stats"]);

// Replace plugins ad-hoc
var three = new THREE.Bootstrap(["core", "stats", "render:myRender"]);
var three = new Threestrap.Bootstrap(["core", "stats", "render:myRender"]);
```

The following global options are available with these defaults:

```javascript
var three = new THREE.Bootstrap({
var three = new Threestrap.Bootstrap({
init: true, // Initialize on creation

element: document.body, // Containing element
Expand Down Expand Up @@ -149,7 +149,7 @@ installed in the given order.
Plug-in specific options are grouped under the plug-in's name:

```javascript
var three = new THREE.Bootstrap({
var three = new Threestrap.Bootstrap({
plugins: ["core", "stats"],
size: {
width: 1280,
Expand Down
Loading

0 comments on commit 4ac35fd

Please sign in to comment.