77var Class = require ( '../utils/Class' ) ;
88var CONST = require ( './const' ) ;
99var NOOP = require ( '../utils/NOOP' ) ;
10- var Vec2 = require ( '../math/Vector2' ) ;
1110var Rectangle = require ( '../geom/rectangle/Rectangle' ) ;
11+ var Size = require ( '../structs/Size' ) ;
12+ var SnapFloor = require ( '../math/snap/SnapFloor' ) ;
13+ var Vec2 = require ( '../math/Vector2' ) ;
1214
1315/**
1416 * @classdesc
@@ -41,19 +43,25 @@ var ScaleManager = new Class({
4143 this . scaleMode = 0 ;
4244
4345 // The base game size, as requested in the game config
44- this . width = 0 ;
45- this . height = 0 ;
46+ this . gameSize = new Size ( ) ;
4647
4748 // The canvas size, which is the base game size * zoom * resolution
48- this . canvasWidth = 0 ;
49- this . canvasHeight = 0 ;
49+ this . canvasSize = new Size ( ) ;
50+
51+ // this.width = 0;
52+ // this.height = 0;
53+
54+ // this.canvasWidth = 0;
55+ // this.canvasHeight = 0;
5056
5157 this . resolution = 1 ;
5258 this . zoom = 1 ;
5359
5460 // The actual displayed canvas size (after refactoring in CSS depending on the scale mode, parent, etc)
55- this . displayWidth = 0 ;
56- this . displayHeight = 0 ;
61+ this . displaySize = new Size ( ) ;
62+
63+ // this.displayWidth = 0;
64+ // this.displayHeight = 0;
5765
5866 // The scale factor between the base game size and the displayed size
5967 this . scale = new Vec2 ( 1 ) ;
@@ -71,6 +79,8 @@ var ScaleManager = new Class({
7179
7280 this . allowFullScreen = false ;
7381
82+ this . snap = new Vec2 ( 1 , 1 ) ;
83+
7484 this . listeners = {
7585
7686 orientationChange : NOOP ,
0 commit comments