Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions creator/sdk7/2d-ui/ui-positioning.md
Original file line number Diff line number Diff line change
Expand Up @@ -316,3 +316,7 @@ Some other best practices regarding UI sizes:

* If the width or height of any UI element is dynamic, it's good to also use the `maxWidth`, `minWidth`, `maxHeight`, and `minHeight` parameters to make sure they stay within reasonable values.
* A numeric font size is a virtual pixel value, scaled like any other. If you want a size measured against the canvas instead, so it holds regardless of the virtual screen, pass a `vw`/`vh` string — see [Responsive text size](ui_text.md#responsive-text-size)

{% hint style="info" %}
**💡 Tip**: For working examples of UI sizing, see the [`81,-2-ui-screen-inset-area`](https://github.com/decentraland/sdk7-test-scenes/tree/main/scenes/81,-2-ui-screen-inset-area) test scene, which runs all three `screenInset` modes (`'none'`, `'device'`, `'interactable'`) as three coexisting renderers and prints the live `screenInsetArea` and `interactableArea` values, and [`76,-10-UiCanvasInformation`](https://github.com/decentraland/sdk7-test-scenes/tree/main/scenes/76,-10-UiCanvasInformation), which reads `UiCanvasInformation` each frame to size UI responsively.
{% endhint %}
4 changes: 4 additions & 0 deletions creator/sdk7/3d-essentials/camera.md
Original file line number Diff line number Diff line change
Expand Up @@ -316,3 +316,7 @@ function main() {
When a player's camera moves in 3rd person mode, the camera might be blocked by colliders or not, depending on the collision layers assigned to the entities. Be mindful of this when designing your scene, you may want to prevent the camera from going through walls or other entities.

See [Colliders](colliders.md#cameras-and-colliders) for more details on how to configure colliders for your scene.

{% hint style="info" %}
**💡 Tip**: For working examples of camera control, see the [`2,22-virtual-cameras`](https://github.com/decentraland/sdk7-test-scenes/tree/main/scenes/2,22-virtual-cameras) test scene, which cycles several `VirtualCamera` entities through `MainCamera` including `lookAtEntity` aimed at the player and a tweened camera; [`32,20-virtual-camera-mouse-look`](https://github.com/decentraland/sdk7-test-scenes/tree/main/scenes/32,20-virtual-camera-mouse-look), which drives a mouselook camera while the pointer is locked; and [`9,99-modifier-areas`](https://github.com/decentraland/sdk7-test-scenes/tree/main/scenes/9,99-modifier-areas), which forces a camera mode inside a volume with `CameraModeArea`.
{% endhint %}
4 changes: 4 additions & 0 deletions creator/sdk7/3d-essentials/lights.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,3 +284,7 @@ For example, the image below displays each of the letters on different sides of
{% hint style="info" %}
**💡 Tip**: Combine lights with a [Particle System](particle-system.md) for richer visual effects. For example, pair an additive-blend fire particle system with a warm point light to create a convincing campfire.
{% endhint %}

{% hint style="info" %}
**💡 Tip**: For a working example of this component, see the [`0,4-dynamic-lights`](https://github.com/decentraland/sdk7-test-scenes/tree/main/scenes/0,4-dynamic-lights) test scene, which covers both `LightSource.Type.Point` and `LightSource.Type.Spot`, runtime changes via `LightSource.getMutable()`, shadows, and `shadowMaskTexture`.
{% endhint %}
4 changes: 4 additions & 0 deletions creator/sdk7/3d-essentials/materials.md
Original file line number Diff line number Diff line change
Expand Up @@ -830,3 +830,7 @@ GltfNodeModifiers.create(myEntity, {
{% hint style="info" %}
**💡 Tip**: Textures used in materials can also be applied to particle effects. See [Particle System](particle-system.md) for details on using custom textures and sprite sheets with particles.
{% endhint %}

{% hint style="info" %}
**💡 Tip**: For working examples of materials, see the [`52,-52-testing-gallery`](https://github.com/decentraland/sdk7-test-scenes/tree/main/scenes/52,-52-testing-gallery) test scene, which sweeps PBR metallic/roughness/emissive/normal-map combinations side by side, [`74,-8-gltfnodemodifier`](https://github.com/decentraland/sdk7-test-scenes/tree/main/scenes/74,-8-gltfnodemodifier), which overrides PBR and unlit materials on individual GLTF nodes, and [`0,3-texture-movement`](https://github.com/decentraland/sdk7-test-scenes/tree/main/scenes/0,3-texture-movement), which animates texture offset and tiling.
{% endhint %}
4 changes: 3 additions & 1 deletion creator/sdk7/3d-essentials/particle-system.md
Original file line number Diff line number Diff line change
Expand Up @@ -365,4 +365,6 @@ Also keep in mind that particles can only be seen by a player while they're stan

Enter the world [ParticleLab.dcl.eth](decentraland://?realm=particlelab.dcl.eth&dclenv=org) to experiment with different particle systems. When you approach a particle system, the UI will display all the available fields, you can tweak them live without needing to reload the scene. When you're happy, click the **Copy** button to copy the code for that particle system to your clipboard.


{% hint style="info" %}
**💡 Tip**: For a working example that exercises every `ParticleSystem` field, see the [`0,7-particle-system`](https://github.com/decentraland/sdk7-test-scenes/tree/main/scenes/0,7-particle-system) test scene. It covers all four emitter shapes, the `PSB_ADD`/`PSB_ALPHA`/`PSB_MULTIPLY` blend modes, the `PS_PLAYING`/`PS_PAUSED`/`PS_STOPPED` playback states, sprite sheets, continuous `rate` against one-shot and looping `bursts`, and `PSS_LOCAL` against `PSS_WORLD` on a moving emitter.
{% endhint %}
4 changes: 4 additions & 0 deletions creator/sdk7/3d-essentials/trigger-areas.md
Original file line number Diff line number Diff line change
Expand Up @@ -285,3 +285,7 @@ Transform.create(triggerEntity, {
```

This will activate the trigger area when any entity with the layers `CL_CUSTOM1` or `CL_CUSTOM2` enters the trigger area.

{% hint style="info" %}
**💡 Tip**: For a working example that exercises `TriggerArea` end-to-end, see the [`75,-9-trigger-areas`](https://github.com/decentraland/sdk7-test-scenes/tree/main/scenes/75,-9-trigger-areas) test scene, which covers the ENTER/EXIT wire contract and the SDK's per-tick `onTriggerStay` synthesis, rotated areas, moving triggerers on custom collider layers, and areas attached to falling entities. To see how the collider layers themselves behave, see [`5,5-collider-layers`](https://github.com/decentraland/sdk7-test-scenes/tree/main/scenes/5,5-collider-layers).
{% endhint %}
2 changes: 1 addition & 1 deletion creator/sdk7/getting-started/useful-resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Use the Decentraland SDK7 Test Scenes to see working examples of specific SDK fe

See how Decentraland's Multiplayer server can be used to build a resilient leaderboard. The server owns the game state, validates each score, persists per-player totals, and broadcasts a ranked leaderboard that every Decentraland client can render.

🔗 [Multiplayer server leaderboard test scene](https://github.com/decentraland/sdk7-test-scenes/tree/main/scenes/90%2C-9-authoritative-server-leaderboard)
🔗 [Multiplayer server leaderboard test scene](https://github.com/decentraland/sdk7-test-scenes/tree/main/scenes/90,-9-authoritative-server-leaderboard)

See [Authoritative Servers](../networking/authoritative-servers.md) to learn how to build on the authoritative server.

Expand Down
4 changes: 4 additions & 0 deletions creator/sdk7/interactivity/event-listeners.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,3 +265,7 @@ Each event contains:
* `ui`: Which panel the event is about (an `ExplorerUi` value).
* `timestamp`: A monotonic counter for when the event occurred.
* `event`: Either `{ $case: 'opened' }` or `{ $case: 'closed' }`.

{% hint style="info" %}
**💡 Tip**: For a working example of emote playback events, see the [`4,23-emote-finish`](https://github.com/decentraland/sdk7-test-scenes/tree/main/scenes/4,23-emote-finish) test scene, which logs every `AvatarEmoteCommand` entry appended to the player entity as `STARTED`, `FINISHED` or `INTERRUPTED` — play an emote out fully to see `FINISHED`, or walk away mid-playback to see `INTERRUPTED`.
{% endhint %}
4 changes: 4 additions & 0 deletions creator/sdk7/interactivity/mouse-movement.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,3 +185,7 @@ A few things to note about this example:
To read the cursor's absolute position on the screen instead of its movement, use the `screenCoordinates` property of the same component. See [Check the player's cursor position](user-data.md#check-the-players-cursor-position).

To find out which entity is under the cursor, combine the `worldRayDirection` property with a raycast. See [Raycasting](raycasting.md).

{% hint style="info" %}
**💡 Tip**: For working examples of pointer state, see the [`0,5-primary-cursor-info`](https://github.com/decentraland/sdk7-test-scenes/tree/main/scenes/0,5-primary-cursor-info) test scene, which reads `PrimaryPointerInfo` each frame and feeds `worldRayDirection` into a raycast; [`31,20-pointer-lock-control`](https://github.com/decentraland/sdk7-test-scenes/tree/main/scenes/31,20-pointer-lock-control), which requests and releases cursor capture by writing `PointerLock.isPointerLocked`; and [`32,20-virtual-camera-mouse-look`](https://github.com/decentraland/sdk7-test-scenes/tree/main/scenes/32,20-virtual-camera-mouse-look), which shows `screenDelta` still reporting movement while `screenCoordinates` is frozen at the screen center during lock.
{% endhint %}
3 changes: 3 additions & 0 deletions creator/sdk7/interactivity/player-avatar.md
Original file line number Diff line number Diff line change
Expand Up @@ -722,3 +722,6 @@ See [NPC Avatars](npc-avatars.md) for more details.
The fluidity of control may not be perfect while doing this, you may want to use this only in very specific cases.
{% endhint %}

{% hint style="info" %}
**💡 Tip**: For working examples of these APIs, see the [`0,1-input-modifier`](https://github.com/decentraland/sdk7-test-scenes/tree/main/scenes/0,1-input-modifier) test scene, which toggles each `InputModifier` movement flag separately and shows an avatar still being carried by a moving platform while movement is blocked; [`9,99-modifier-areas`](https://github.com/decentraland/sdk7-test-scenes/tree/main/scenes/9,99-modifier-areas), which combines `AvatarModifierArea` with runtime-mutated `excludeIds`; and [`10,99-avatar-modifier-hide-nametags`](https://github.com/decentraland/sdk7-test-scenes/tree/main/scenes/10,99-avatar-modifier-hide-nametags), which isolates the `AMT_HIDE_NAMETAGS` modifier.
{% endhint %}
4 changes: 4 additions & 0 deletions creator/sdk7/interactivity/raycasting.md
Original file line number Diff line number Diff line change
Expand Up @@ -660,3 +660,7 @@ engine.addSystem(() => {
{% endhint %}

In a scene where you use multiple kinds of rays for different purposes (like for path finding, line-of-sight checking, projectile tracing, etc), you might want to use different [collision layers](../3d-essentials/colliders.md#collision-layers), to avoid calculating irrelevant collisions.

{% hint style="info" %}
**💡 Tip**: For a working example of raycasting, see the [`77,-1-raycast-unit-tests`](https://github.com/decentraland/sdk7-test-scenes/tree/main/scenes/77,-1-raycast-unit-tests) test scene, which asserts raycast behavior through `@dcl/sdk/testing` unit tests across the `localDirection`, `globalDirection`, `globalTarget` and `targetEntity` direction forms, including rays cast from transformed parents. To see how the collider layers a ray can hit behave, see [`5,5-collider-layers`](https://github.com/decentraland/sdk7-test-scenes/tree/main/scenes/5,5-collider-layers).
{% endhint %}
4 changes: 4 additions & 0 deletions creator/sdk7/interactivity/skybox-control.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,7 @@ function main() {
SkyboxTime.create(engine.RootEntity, { fixedTime: 36000, transitionMode: TransitionMode.TM_BACKWARD })
}
```

{% hint style="info" %}
**💡 Tip**: For working examples of skybox control, see the [`2,1-skybox-sdk-scene-a`](https://github.com/decentraland/sdk7-test-scenes/tree/main/scenes/2,1-skybox-sdk-scene-a) and [`3,1-skybox-sdk-scene-b`](https://github.com/decentraland/sdk7-test-scenes/tree/main/scenes/3,1-skybox-sdk-scene-b) test scenes, which drive `SkyboxTime` and `TransitionMode` live from a UI panel, and [`2,0-skybox-scene-json`](https://github.com/decentraland/sdk7-test-scenes/tree/main/scenes/2,0-skybox-scene-json), which reads the `fixedTime` set in `scene.json` back at runtime via `getSceneInformation()`.
{% endhint %}
4 changes: 4 additions & 0 deletions creator/sdk7/media/video-playing.md
Original file line number Diff line number Diff line change
Expand Up @@ -498,3 +498,7 @@ Material.setBasicMaterial(videoPlayerEntity, {
## Audio analysis

You can read real-time amplitude and frequency data from the audio track of a `VideoPlayer` entity to drive reactive visuals that sync with the video's soundtrack. See [Audio analysis](audio-analysis.md).

{% hint style="info" %}
**💡 Tip**: To see video played on a GLTF model rather than a primitive, see the [`74,-8-gltfnodemodifier`](https://github.com/decentraland/sdk7-test-scenes/tree/main/scenes/74,-8-gltfnodemodifier) test scene, which drives an HLS stream onto specific GLTF nodes using `GltfNodeModifiers` video textures.
{% endhint %}
4 changes: 4 additions & 0 deletions creator/sdk7/optimizing/pre-load-resources.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,7 @@ assetLoadLoadingStateSystem.registerAssetLoadLoadingStateEntity(
{% hint style="info" %}
**💡 Tip**: You can add more assets to an existing `AssetLoad` component after creating it, for example in response to a player action. Use `AssetLoad.getOrCreateMutable()` to fetch the component and push new paths onto its `assets` array. The registered callback will also fire for these newly added assets as they download.
{% endhint %}

{% hint style="info" %}
**💡 Tip**: For a working example of this component, see the [`88,-12-asset-load`](https://github.com/decentraland/sdk7-test-scenes/tree/main/scenes/88,-12-asset-load) test scene, which pre-loads an mp3, a texture, a video and a glb through one `AssetLoad` component and reports each asset's state through `assetLoadLoadingStateSystem` — including a deliberately missing path that resolves to `NOT_FOUND`.
{% endhint %}