Adds ESM Tutorials#669
Merged
marklundin merged 113 commits intomainfrom Jun 23, 2025
Merged
Conversation
Co-authored-by: Will Eastcott <[email protected]>
Co-authored-by: Will Eastcott <[email protected]>
Co-authored-by: Will Eastcott <[email protected]>
Co-authored-by: Will Eastcott <[email protected]>
Co-authored-by: Will Eastcott <[email protected]>
Co-authored-by: Will Eastcott <[email protected]>
Co-authored-by: Will Eastcott <[email protected]>
Co-authored-by: Will Eastcott <[email protected]>
Co-authored-by: Will Eastcott <[email protected]>
Co-authored-by: Will Eastcott <[email protected]>
Co-authored-by: Will Eastcott <[email protected]>
Co-authored-by: Will Eastcott <[email protected]>
Co-authored-by: Will Eastcott <[email protected]>
Co-authored-by: Will Eastcott <[email protected]>
Co-authored-by: Will Eastcott <[email protected]>
Co-authored-by: Will Eastcott <[email protected]>
Co-authored-by: Will Eastcott <[email protected]>
…veloper.playcanvas.com into feat-esm-tutorials
Co-authored-by: Will Eastcott <[email protected]>
Co-authored-by: Will Eastcott <[email protected]>
Co-authored-by: Will Eastcott <[email protected]>
Co-authored-by: Will Eastcott <[email protected]>
Co-authored-by: Will Eastcott <[email protected]>
…veloper.playcanvas.com into feat-esm-tutorials
Co-authored-by: Will Eastcott <[email protected]>
…veloper.playcanvas.com into feat-esm-tutorials
…player tutorial for improved clarity and consistency
Contributor
There was a problem hiding this comment.
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 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.