Skip to content

Commit 2f4c948

Browse files
committed
update docs
1 parent 1771a43 commit 2f4c948

File tree

3 files changed

+10
-16
lines changed

3 files changed

+10
-16
lines changed

docs/pages/pin.md

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -111,18 +111,9 @@ component.alpha(alpha, textureAlpha);
111111

112112
Fit to given size. Valid modes are:
113113

114-
- `contain`: like `in`, but evenly pads component to fill the entire scaleWidth/Height
115-
- `cover`: like `out`, but evenly crops it to scaleWidth/Height
116-
- `in`: maximum scale which keeps component edges inside the scaleWidth/Height
117-
- `out`: minimum scale which keeps component edges outside scaleWidth/Height
114+
- `contain`: component contains within the provided size
115+
- `cover`: component covers the provided size
118116

119117
```javascript
120-
component.pin({
121-
scaleMode: mode,
122-
scaleWidth: width,
123-
scaleHeight: height,
124-
});
125-
126-
// Shortcut method:
127118
component.fit(width, height, mode);
128119
```

docs/pages/setup.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ const app = Stage.mount({
1212
canvas: document.getElementById("game-canvas"),
1313
});
1414

15-
// Set viewbox for stage, see pinning for valid modes
16-
app.viewbox(width, height, (mode = "in-pad"));
15+
// Set viewbox for stage
16+
app.viewbox(width, height, "contain");
1717

1818
// Listen to view port resize events
1919
app.on("viewport", function (viewport) {
@@ -35,9 +35,12 @@ app.resume();
3535
// Mount and start a new app
3636
let app = Stage.mount();
3737

38-
// Create and preload a texture atlas
38+
// Create a texture atlas, call with await to ensure it's loaded
3939
Stage.atlas({ ... });
4040

41+
// Preload all texture atlases, if you don't want to await each individually
42+
await Stage.preload({ ... });
43+
4144
// Pause playing all applications
4245
Stage.pause();
4346

docs/pages/transition.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ const transition = component.tween({
1818
transition.pin(pinning);
1919

2020
// Set easing function for transition, it can be either a function or an identifier
21-
// defined as 'name[-mode][(params)]', for example 'quad' or 'poly-in-out(3)'
21+
// defined as 'name[-mode]', for example ease('quad') or ease('poly-in-out').
2222
// Names: linear, quad, cubic, quart, quint, poly(p), sin/sine,
2323
// exp, circle/circ, bounce, elastic(a, p), back(s)
2424
// Modes: in, out, in-out, out-in
25-
transition.ease(easing);
25+
transition.ease(easing, ...params);
2626

2727
// Set duration in milliseconds
2828
transition.duration(ms);

0 commit comments

Comments
 (0)