File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1284,6 +1284,40 @@ var Camera = new Class({
12841284 this . _bounds = null ;
12851285
12861286 this . scene = null ;
1287+ } ,
1288+
1289+ /**
1290+ * The x position of the center of the Camera's viewport, relative to the top-left of the game canvas.
1291+ *
1292+ * @name Phaser.Cameras.Scene2D.Camera#centerX
1293+ * @type {number }
1294+ * @readOnly
1295+ * @since 3.10.0
1296+ */
1297+ centerX : {
1298+
1299+ get : function ( )
1300+ {
1301+ return this . x + ( 0.5 * this . width ) ;
1302+ }
1303+
1304+ } ,
1305+
1306+ /**
1307+ * The y position of the center of the Camera's viewport, relative to the top-left of the game canvas.
1308+ *
1309+ * @name Phaser.Cameras.Scene2D.Camera#centerY
1310+ * @type {number }
1311+ * @readOnly
1312+ * @since 3.10.0
1313+ */
1314+ centerY : {
1315+
1316+ get : function ( )
1317+ {
1318+ return this . y + ( 0.5 * this . height ) ;
1319+ }
1320+
12871321 }
12881322
12891323} ) ;
You can’t perform that action at this time.
0 commit comments