-
Notifications
You must be signed in to change notification settings - Fork 57
Adds ESM Tutorials #669
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds ESM Tutorials #669
Conversation
Co-authored-by: Will Eastcott <will@playcanvas.com>
Co-authored-by: Will Eastcott <will@playcanvas.com>
Co-authored-by: Will Eastcott <will@playcanvas.com>
Co-authored-by: Will Eastcott <will@playcanvas.com>
Co-authored-by: Will Eastcott <will@playcanvas.com>
Co-authored-by: Will Eastcott <will@playcanvas.com>
Co-authored-by: Will Eastcott <will@playcanvas.com>
Co-authored-by: Will Eastcott <will@playcanvas.com>
Co-authored-by: Will Eastcott <will@playcanvas.com>
Co-authored-by: Will Eastcott <will@playcanvas.com>
Co-authored-by: Will Eastcott <will@playcanvas.com>
Co-authored-by: Will Eastcott <will@playcanvas.com>
Co-authored-by: Will Eastcott <will@playcanvas.com>
Co-authored-by: Will Eastcott <will@playcanvas.com>
Co-authored-by: Will Eastcott <will@playcanvas.com>
Co-authored-by: Will Eastcott <will@playcanvas.com>
Co-authored-by: Will Eastcott <will@playcanvas.com>
…veloper.playcanvas.com into feat-esm-tutorials
Co-authored-by: Will Eastcott <will@playcanvas.com>
Co-authored-by: Will Eastcott <will@playcanvas.com>
Co-authored-by: Will Eastcott <will@playcanvas.com>
Co-authored-by: Will Eastcott <will@playcanvas.com>
Co-authored-by: Will Eastcott <will@playcanvas.com>
…veloper.playcanvas.com into feat-esm-tutorials
Co-authored-by: Will Eastcott <will@playcanvas.com>
…veloper.playcanvas.com into feat-esm-tutorials
…player tutorial for improved clarity and consistency
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds ESM (ES Modules) versions of all tutorial code examples alongside the existing Classic scripts by wrapping them in <Tabs> and <TabItem> components.
- Introduced ESM code snippets for each tutorial using PlayCanvas’s new module API.
- Wrapped legacy Classic examples in corresponding
<TabItem>blocks for side-by-side comparisons. - Ensured each tutorial markdown file includes the necessary imports and closing tags for the new tabbed layout.
Reviewed Changes
Copilot reviewed 45 out of 45 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/tutorials/music-visualizer.md | Wrapped analyser and visualizer scripts in Tabs; added ESM versions. |
| docs/tutorials/mouse-input.md | Added ESM version of mouse input example and Tabs. |
| docs/tutorials/more-cameras.md | Added ESM zoom and camera manager code with Tabs. |
| docs/tutorials/loading-json.md | Added ESM game script example inside Tabs. |
| docs/tutorials/light-halos.md | Wrapped halo script examples in Tabs with ESM. |
| docs/tutorials/keyboard-input.md | Introduced ESM keyboard handler and Tabs. |
| docs/tutorials/keepyup-part-three.md | Added ESM Game and Input scripts for KeepyUp part three. |
| docs/tutorials/keepyup-part-six.md | Inserted ESM UiMenu example in part six. |
| docs/tutorials/keepyup-part-four.md | Wrapped ESM Ball script for part four. |
| docs/tutorials/google-ads-for-games.md | Added ESM UiController example with Tabs. |
| docs/tutorials/first-person-movement.md | Introduced full ESM FPS movement code in Tabs. |
| docs/tutorials/facebook-api.md | Wrapped FbUi and FacePhoto ESM examples in Tabs. |
| docs/tutorials/entity-picking.md | Added ESM raycast and framebuffer picker code in Tabs. |
| docs/tutorials/custom-shaders.md | Wrapped ESM CustomShader examples in Tabs. |
| docs/tutorials/custom-posteffect.md | Added ESM WaterColor post-effect example. |
| docs/tutorials/controlling-lights.md | Wrapped LightHandler ESM example in Tabs. |
| docs/tutorials/collision-and-triggers.md | Added ESM Trigger and Collider scripts in Tabs. |
| docs/tutorials/animation-blending.md | Wrapped ESM AnimationBlending code in Tabs. |
| docs/tutorials/anim-blending.md | Added ESM KeyboardControls example in Tabs. |
| docs/tutorials/Using-forces-on-rigid-bodies.md | Introduced ESM Movement script in Tabs. |
Comments suppressed due to low confidence (3)
docs/tutorials/entity-picking.md:41
- [nitpick] The scriptName casing (
pickerRayCast) differs from the Classic version (pickerRaycast); update to match the existing registration.
static scriptName = "pickerRayCast";
docs/tutorials/music-visualizer.md:156
- Duplicated
.analyser.analyserchain is incorrect; you should accessminDecibelsdirectly on the analyser node (e.g.,this.analyser.script.analyser.minDecibels).
this.minDb = this.analyser.script.analyser.analyser.minDecibels;
docs/tutorials/music-visualizer.md:157
- Similar to
minDecibels, drop the extra.analyserand usethis.analyser.script.analyser.maxDecibelsdirectly.
this.maxDb = this.analyser.script.analyser.analyser.maxDecibels;
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
willeastcott
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Updates all tutorials to include both Classic and ESM versions of code examples.
I confirm I have read the contributing guidelines and signed the Contributor License Agreement.