Skip to content

Commit b6e9d42

Browse files
committed
Added backgroundColor to Camera config.
1 parent 8ab8a59 commit b6e9d42

4 files changed

Lines changed: 14 additions & 48 deletions

File tree

v3/src/camera/Camera.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,7 @@ Camera.prototype = {
309309
roundPixels: bool
310310
scrollX: float
311311
scrollY: float
312+
backgroundColor: string
312313
bounds: {
313314
x: int
314315
y: int
@@ -329,7 +330,8 @@ Camera.prototype = {
329330
rotation: this.rotation,
330331
roundPixels: this.roundPixels,
331332
scrollX: this.scrollX,
332-
scrollY: this.scrollY
333+
scrollY: this.scrollY,
334+
backgroundColor: this.backgroundColor.rgba
333335
};
334336

335337
if (this.useBounds)

v3/src/checksum.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
var CHECKSUM = {
2-
build: '86cb31f0-5ce1-11e7-a901-dbab721a365f'
2+
build: '0a9c3370-5ce3-11e7-886b-43134c9cdc6e'
33
};
44
module.exports = CHECKSUM;

v3/src/state/Settings.js

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,6 @@ var GetValue = require('../utils/object/GetValue');
44

55
var Settings = {
66

7-
/*
8-
{
9-
cameras: [
10-
{
11-
x: int
12-
y: int
13-
width: int
14-
height: int
15-
zoom: float
16-
rotation: float
17-
roundPixels: bool
18-
scrollX: float
19-
scrollY: float
20-
bounds: {
21-
x: int
22-
y: int
23-
width: int
24-
height: int
25-
}
26-
}
27-
]
28-
}
29-
*/
30-
317
create: function (config)
328
{
339
if (typeof config === 'string')
@@ -60,13 +36,6 @@ var Settings = {
6036

6137
cameras: GetValue(config, 'cameras', null),
6238

63-
// -1 means the State Manager will set it to be the Game dimensions
64-
// x: GetValue(config, 'x', 0),
65-
// y: GetValue(config, 'y', 0),
66-
// rotation: GetValue(config, 'rotation', 0),
67-
// width: GetValue(config, 'width', -1),
68-
// height: GetValue(config, 'height', -1),
69-
7039
// State Render Settings (applies only to this State)
7140

7241
scaleMode: GetValue(config, 'scaleMode', ScaleModes.DEFAULT),
@@ -82,21 +51,6 @@ var Settings = {
8251
};
8352
}
8453

85-
/*
86-
init: function (config, gameConfig)
87-
{
88-
if (config.width === -1)
89-
{
90-
config.width = gameConfig.width;
91-
}
92-
93-
if (config.height === -1)
94-
{
95-
config.height = gameConfig.height;
96-
}
97-
}
98-
*/
99-
10054
};
10155

10256
module.exports = Settings;

v3/src/state/systems/CameraManager.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ CameraManager.prototype = {
4343
roundPixels: bool
4444
scrollX: float
4545
scrollY: float
46+
backgroundColor: string
4647
bounds: {
4748
x: int
4849
y: int
@@ -82,6 +83,15 @@ CameraManager.prototype = {
8283
camera.scrollY = GetFastValue(cameraConfig, 'scrollY', 0);
8384
camera.roundPixels = GetFastValue(cameraConfig, 'roundPixels', false);
8485

86+
// Background Color
87+
88+
var backgroundColor = GetFastValue(cameraConfig, 'backgroundColor', false);
89+
90+
if (backgroundColor)
91+
{
92+
camera.setBackgroundColor(backgroundColor);
93+
}
94+
8595
// Bounds
8696

8797
var boundsConfig = GetFastValue(cameraConfig, 'bounds', null);

0 commit comments

Comments
 (0)