Skip to content

Commit

Permalink
Example update
Browse files Browse the repository at this point in the history
  • Loading branch information
tentone committed Sep 3, 2024
1 parent 9fde04c commit ee7437b
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion demo/example.bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion demo/example.bundle.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion demo/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html><head><meta charset="UTF-8"/><title>Sync Input</title><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"/><meta name="HandheldFriendly" content="true"/><script defer="defer" src="example.bundle.js"></script></head><body><canvas id="canvas" style="position: absolute; display: block; width: 100%; height: 100%; left: 0px; top: 0px;"></canvas><div id="fps" style="color: #000000; position: absolute; display: block; width: 200px; height: 30px; left: 5px; top: 10px;"></div><div type="checkbox" style="color: #000000; position: absolute; display: block; width: fit-content; height: 20px; right: 5px; top: 10px;">Vsync <input id="vsync" type="checkbox" style="color: #000000; display: inline; width: 20px; height: 20px;"></div><div type="number" style="color: #000000; position: absolute; display: block; width: fit-content; height: 20px; right: 5px; top: 50px;">FrameRate <input id="rate" type="number" style="color: #000000; display: inline; width: 50px; height: 20px;"></div><div style="color: #000000; position: absolute; display: block; width: calc(100% - 20px); height: fit-content; left: 10px; bottom: 5px; text-align: center;">Pinch to zoom the cube, 2 touch to move the cube, 3 touch to move camera vertically and single touch to rotate.<br>Move cube with keyboard or gamepad.<br>Rotate cube with mouse. Double click to change color.</div></body></html>
<!doctype html><html><head><meta charset="UTF-8"/><title>Sync Input</title><meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"/><meta name="HandheldFriendly" content="true"/><script defer="defer" src="example.bundle.js"></script></head><body><canvas id="canvas" style="position: absolute; display: block; width: 100%; height: 100%; left: 0px; top: 0px;"></canvas><div id="fps" style="color: #000000; position: absolute; display: block; width: 200px; height: 30px; left: 5px; top: 10px;"></div><div type="checkbox" style="color: #000000; position: absolute; display: block; width: fit-content; height: 20px; right: 5px; top: 10px;">Vsync <input id="vsync" type="checkbox" style="color: #000000; display: inline; width: 20px; height: 20px;"></div><div type="number" style="color: #000000; position: absolute; display: block; width: fit-content; height: 20px; right: 5px; top: 50px;">FrameRate <input id="rate" type="number" style="color: #000000; display: inline; width: 50px; height: 20px;"></div><div style="color: #000000; position: absolute; display: block; width: calc(100% - 20px); height: fit-content; left: 10px; bottom: 5px; text-align: center;">Pinch to zoom the cube, 2 touch to move the cube, 3 touch to move camera vertically and single touch to rotate.<br>Move cube with keyboard or gamepad (joystick or buttons).<br>Rotate cube with mouse or gamepad. Scroll to zoom. Double click or press A to change color. Press B for haptic rumble.</div></body></html>
2 changes: 0 additions & 2 deletions examples/cube.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,11 @@ class CubeExample extends ExampleBase
this.cube.position.y -= delta;
}


if (this.mouse.buttonPressed(MouseButton.LEFT))
{
this.cube.rotation.y += this.mouse.delta.x / 1e2;
}


this.camera.position.z -= this.gamepad.getAnalogueButton(GamepadButton.RIGHT_TRIGGER_B) / 20;
this.camera.position.z += this.gamepad.getAnalogueButton(GamepadButton.LEFT_TRIGGER_B) / 20;

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"build-example": "webpack --config webpack.example.js",
"start": "webpack-dev-server --https --config webpack.example.js --mode development --progress --port 5200",
"docs": "typedoc --out docs ./source/main.ts",
"pub": "npm run build && npm run docs && npm publish --access public .",
"pub": "npm run build && npm run build-example && npm run docs && npm publish --access public .",
"lint": "eslint --ext .ts .",
"lint-fix": "eslint --ext .ts --fix ."
},
Expand Down

0 comments on commit ee7437b

Please sign in to comment.