Skip to content

Commit 3b353f9

Browse files
committed
Update README
1 parent cceec45 commit 3b353f9

File tree

1 file changed

+12
-24
lines changed

1 file changed

+12
-24
lines changed

README.md

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ Or you can include it directly in your HTML file from a CDN.
1515
ES Modules:
1616

1717
```html
18-
<script type="module" src="https://cdn.jsdelivr.net/npm/@playcanvas/[email protected].0/dist/pwc.mjs"></script>
18+
<script type="module" src="https://cdn.jsdelivr.net/npm/@playcanvas/[email protected].4/dist/pwc.mjs"></script>
1919
```
2020

2121
UMD:
2222

2323
```html
24-
<script src="https://cdn.jsdelivr.net/npm/@playcanvas/[email protected].0"></script>
24+
<script src="https://cdn.jsdelivr.net/npm/@playcanvas/[email protected].4"></script>
2525
```
2626

2727
## Tag Reference 📖
@@ -243,10 +243,12 @@ The `pc-sky` tag is used to define a sky component. It must be a direct child of
243243
| Attribute | Description |
244244
| --- | --- |
245245
| `asset` | A string that should match the `id` of a `pc-asset` tag that has a type of `texture`. |
246+
| `center` | The center of the sky. Specified as a comma-separated list of X, Y, and Z values in the range 0 to 1. If not specified, `0,0.01,0` is used. |
246247
| `intensity` | The intensity of the sky. If not specified, `1` is used. |
247248
| `level` | The mipmap level used to render the sky. If not specified, `0` is used (base mip level). |
248249
| `rotation` | The rotation of the sky. Specified as a comma-separated list of X, Y, and Z values. If not specified, `0,0,0` is used. |
249-
| `solid-color` | Valueless attribute. If present, the skybox itself is not rendered but is still used for environment lighting. |
250+
| `scale` | The scale of the sky. Specified as a comma-separated list of X, Y, and Z values. If not specified, `100,100,100` is used. |
251+
| `type` | The type of sky component. Can be `box`, `dome`, `infinite` or `none`. |
250252

251253
### pc-sound
252254

@@ -285,38 +287,27 @@ The `pc-splat` tag is used to define a splat component. It must be a direct chil
285287

286288
## Example
287289

288-
Below is a basic example of how to use PlayCanvas Web Components to create a simple 3D scene (a spinning cube):
290+
Below is a basic example of how to use PlayCanvas Web Components to create a simple 3D scene (a humble sphere):
289291

290292
```html
291293
<!DOCTYPE html>
292294
<html lang="en">
293295
<head>
294296
<meta charset="UTF-8">
295297
<meta name="viewport" content="width=device-width, initial-scale=1.0">
296-
<title>PlayCanvas Web Components - Spinning Cube</title>
298+
<title>PlayCanvas Web Components - Sphere</title>
297299
<script type="importmap">
298300
{
299301
"imports": {
300-
"playcanvas": "https://esm.run/playcanvas@2.1.0"
302+
"playcanvas": "https://esm.run/playcanvas@2.2.2"
301303
}
302304
}
303305
</script>
304-
<script type="module" src="https://cdn.jsdelivr.net/npm/@playcanvas/[email protected].0/dist/pwc.mjs"></script>
306+
<script type="module" src="https://cdn.jsdelivr.net/npm/@playcanvas/[email protected].4/dist/pwc.mjs"></script>
305307
<link rel="stylesheet" href="styles.css">
306308
</head>
307309
<body>
308310
<pc-app>
309-
<script type="module">
310-
import { registerScript, Script } from 'playcanvas';
311-
312-
class Rotate extends Script {
313-
update(dt) {
314-
this.entity.rotate(10 * dt, 20 * dt, 30 * dt);
315-
}
316-
}
317-
318-
registerScript(Rotate, 'rotate');
319-
</script>
320311
<pc-scene>
321312
<!-- Camera -->
322313
<pc-entity name="camera" position="0,0,3">
@@ -326,12 +317,9 @@ Below is a basic example of how to use PlayCanvas Web Components to create a sim
326317
<pc-entity name="light" rotation="45,0,0">
327318
<pc-light></pc-light>
328319
</pc-entity>
329-
<!-- Cube -->
330-
<pc-entity name="cube">
331-
<pc-render type="box"></pc-render>
332-
<pc-scripts>
333-
<pc-script name="rotate"></pc-script>
334-
</pc-scripts>
320+
<!-- Sphere -->
321+
<pc-entity name="sphere">
322+
<pc-render type="sphere"></pc-render>
335323
</pc-entity>
336324
</pc-scene>
337325
</pc-app>

0 commit comments

Comments
 (0)