Skip to content

Commit 41c9f8b

Browse files
committed
Docs update
1 parent 9675c26 commit 41c9f8b

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ The Tile Sprite Game Object has been given an internal overhaul to make it more
109109

110110
### Updates
111111

112+
* The Camera class has been split into two: `BaseCamera` which contains all of the core Camera functions and properties, and would serve as a great base for you to extend for your own custom Cameras, and `Camera` which is the same name space as previously. `Camera` extends the Base Camera and adds in follower support and the Special Effects. You don't need to update your code, even if currently extending a Camera, as they work the same as before.
112113
* `Camera.x` and `Camera.y` have been turned into getters / setters, mapped to the internal private values `_x` and `_y` respectively. This is so that setting the Camera viewport position directly will now update the new internal resolution calculation vars too.
113114
* `Camera.setScene` will now set the Cameras `resolution` property at the same time and update the internal viewport vars.
114115
* The `Cull Tiles` method used by the Dynamic Tilemap Layer has had a nice and significant optimization. It will now use the cull area dimensions to restrict the amount of tile iteration that takes place per layer, resulting in dramatic reductions in processing time on large layers, or multiple layers (thanks @tarsupin)

src/gameobjects/rendertexture/RenderTexture.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,16 +163,16 @@ var RenderTexture = new Class({
163163
this.frame = this.texture.get();
164164

165165
/**
166-
* An internal Camera that can be used to move around the Render Texture!
166+
* An internal Camera that can be used to move around the Render Texture.
167+
* Control it just like you would any Scene Camera. The difference is that it only impacts the placement of what
168+
* is drawn to the Render Texture. You can scroll, zoom and rotate this Camera.
167169
*
168170
* @name Phaser.GameObjects.RenderTexture#camera
169171
* @type {Phaser.Cameras.Scene2D.BaseCamera}
170172
* @since 3.12.0
171173
*/
172174
this.camera = new Camera(0, 0, width, height);
173175

174-
this.camera.setScene(scene);
175-
176176
/**
177177
* Is this Render Texture dirty or not? If not it won't spend time clearing or filling itself.
178178
*
@@ -207,6 +207,8 @@ var RenderTexture = new Class({
207207
this.drawGameObject = this.batchGameObjectCanvas;
208208
}
209209

210+
this.camera.setScene(scene);
211+
210212
this.setPosition(x, y);
211213
this.setSize(width, height);
212214
this.setOrigin(0, 0);
@@ -270,6 +272,7 @@ var RenderTexture = new Class({
270272
this.frame.glTexture = this.frame.source.glTexture;
271273
}
272274

275+
this.camera.setSize(width, height);
273276
this.frame.setSize(width, height);
274277

275278
this.width = width;

0 commit comments

Comments
 (0)