You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 7, 2024. It is now read-only.
> Note: AudioPlayer and KeyListener are not implemented on the React Native version.
@@ -111,15 +111,15 @@ class ChildComponent extends React.Component {
111
111
static contextTypes = {
112
112
loop:PropTypes.object,
113
113
};
114
-
114
+
115
115
update= () => {
116
116
// tick logic
117
117
};
118
-
118
+
119
119
componentDidMount() {
120
120
this.context.loop.subscribe(this.update);
121
121
}
122
-
122
+
123
123
componentWillUnmount() {
124
124
this.context.loop.unsubscribe(this.update);
125
125
}
@@ -135,7 +135,7 @@ class ChildComponent extends React.Component {
135
135
136
136
**width** (_number_) : Base game width. Defaults to `1024`.
137
137
138
-
The `Stage` component also leverages `context` much like `Loop`, except it passes game scale as `this.context.scale`. You can use this value to appropriately scale positioning and dimension values within your game. Again, you would have to specify `scale: PropTypes.number` in your component's `contextTypes` to receive this value.
138
+
The `Stage` component also leverages `context` much like `Loop`, except it passes game scale as `this.context.scale`. You can use this value to appropriately scale positioning and dimension values within your game. Again, you would have to specify `scale: PropTypes.number` in your component's `contextTypes` to receive this value.
139
139
140
140
--
141
141
@@ -218,6 +218,10 @@ The `Sprite` component lets you define sprite animations using sprite sheets. Wh
218
218
219
219
**tileSize** (number) : Tilemap tile size.
220
220
221
+
**width** (number) : Tilemap width.
222
+
223
+
**height** (number) : Tilemap height.
224
+
221
225
The `TileMap` component lets you define tile maps from a tile atlas. Your tilemap is made of up rows and columns. Each layer is then drawn using those numbers as reference. So for example, if you had 4 rows and 4 columns, with 1 layer, your `layers` prop would look like:
0 commit comments