Skip to content

Commit

Permalink
refactor(examples): update FPS overlay handling in param-test
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Jan 4, 2025
1 parent 13a05a5 commit 27b3576
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
3 changes: 2 additions & 1 deletion examples/param-test/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<script src="./lib/genart.js"></script>
<!-- platform adapter -->
<script src="./lib/adapter-urlparams.js"></script>
<script src="./lib/time-fps-overlay.js"></script>
<style>
body {
margin: 0;
Expand All @@ -31,7 +32,7 @@
<script>
// use custom time provider
// $genart.setTimeProvider($genart.time.offline(250, 60));
$genart.setTimeProvider($genart.time.debug());
$genart.setTimeProvider(timeProviderFPSOverlay());
</script>
<script type="module" src="/src/index.ts"></script>
</body>
Expand Down
5 changes: 3 additions & 2 deletions examples/param-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@
"license": "MIT",
"type": "module",
"scripts": {
"build:prepare": "node ../../tools/copy-lib.js",
"build:prepare": "node ../../tools/copy-lib.js && cp ../../packages/time-fps-overlay/time-fps-overlay.js public/lib",
"start": "yarn build:prepare && vite --host --open",
"build": "yarn build:prepare && tsc && vite build --base='./'",
"preview": "vite preview --host --open"
},
"dependencies": {
"@genart-api/core": "workspace:^"
"@genart-api/core": "workspace:^",
"@genart-api/time-fps-overlay": "workspace:^"
},
"devDependencies": {
"typescript": "^5.7.2",
Expand Down
5 changes: 1 addition & 4 deletions examples/param-test/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,5 @@
"genart:info",
(msg) => (info.innerText = JSON.stringify(msg, null, 4))
);
setInterval(
() => postMessage({ type: "genart:get-info", apiID: "param-test" }),
1000
);
setInterval(() => $genart.emit({ type: "genart:get-info" }), 1000);
})();
3 changes: 2 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@ __metadata:
resolution: "@example/param-test@workspace:examples/param-test"
dependencies:
"@genart-api/core": "workspace:^"
"@genart-api/time-fps-overlay": "workspace:^"
typescript: "npm:^5.7.2"
vite: "npm:^5.4.11"
vite-plugin-html: "npm:^3.2.2"
Expand Down Expand Up @@ -489,7 +490,7 @@ __metadata:
languageName: unknown
linkType: soft

"@genart-api/time-fps-overlay@workspace:packages/time-fps-overlay":
"@genart-api/time-fps-overlay@workspace:^, @genart-api/time-fps-overlay@workspace:packages/time-fps-overlay":
version: 0.0.0-use.local
resolution: "@genart-api/time-fps-overlay@workspace:packages/time-fps-overlay"
dependencies:
Expand Down

0 comments on commit 27b3576

Please sign in to comment.