Skip to content

Commit

Permalink
Update description
Browse files Browse the repository at this point in the history
  • Loading branch information
rexrainbow committed Sep 14, 2023
1 parent e90d255 commit 9358ad9
Show file tree
Hide file tree
Showing 11 changed files with 964 additions and 645 deletions.
38 changes: 28 additions & 10 deletions docs/docs/dynamic-texture.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ texture.draw(entries);
- `alpha`, `tint` : Only used by Texture Frames.
- Game Objects use their own alpha and tint values when being drawn.

### Erase game object
### Erase

```javascript
texture.erase(entries);
Expand All @@ -91,15 +91,6 @@ texture.erase(entries);

### Draw frame

```javascript
texture.drawFrame(key, frame, x, y);
// texture.drawFrame(key, frame, x, y, alpha, tint);
```

- `x`, `y` : Top-left position

or

```javascript
texture.stamp(key, frame, x, y, {
alpha: 1,
Expand All @@ -117,6 +108,16 @@ texture.stamp(key, frame, x, y, {
})
```

or

```javascript
texture.drawFrame(key, frame, x, y);
// texture.drawFrame(key, frame, x, y, alpha, tint);
```

- `x`, `y` : Top-left position


### Draw repeat frames

- Repeat frames full of size
Expand Down Expand Up @@ -183,6 +184,23 @@ texture.add(name, sourceIndex, x, y, width, height);
texture.endDraw();
```

### Internal camera

Internal camera `texture.camera`

- Scroll (offset)
```javascript
texture.camera.setScroll(x, y);
```
- Zoom (scale)
```javascript
texture.camera.setZoom(zoom);
```
- Rotate
```javascript
texture.camera.setAngle(angle); // angle in degrees
```

### Snapshot

#### Snapshot area
Expand Down
Loading

0 comments on commit 9358ad9

Please sign in to comment.