File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ var Config = function (config)
2525
2626 this . width = GetObjectValue ( config , 'width' , 1024 ) ;
2727 this . height = GetObjectValue ( config , 'height' , 768 ) ;
28+ this . zoom = GetObjectValue ( config , 'zoom' , 1 ) ;
2829
2930 this . resolution = GetObjectValue ( config , 'resolution' , 1 ) ;
3031
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ var CanvasPool = require('../dom/CanvasPool');
99var Features = require ( '../device/Features' ) ;
1010var CanvasRenderer = require ( '../renderer/canvas/CanvasRenderer' ) ;
1111var WebGLRenderer = require ( '../renderer/webgl/WebGLRenderer' ) ;
12+ var CanvasInterpolation = require ( '../dom/CanvasInterpolation' ) ;
1213
1314/**
1415* Checks if the device is capable of using the requested renderer and sets it up or an alternative if not.
@@ -56,16 +57,27 @@ var CreateRenderer = function (game)
5657 game . canvas . style = config . canvasStyle ;
5758 }
5859
60+ // Pixel Art mode?
61+ if ( config . pixelArt )
62+ {
63+ CanvasInterpolation . setCrisp ( game . canvas ) ;
64+ }
65+
66+ // Zoomed?
67+ if ( config . zoom !== 1 )
68+ {
69+ game . canvas . style . width = ( config . width * config . zoom ) . toString ( ) + 'px' ;
70+ game . canvas . style . height = ( config . height * config . zoom ) . toString ( ) + 'px' ;
71+ }
72+
5973 // Create the renderer
6074 if ( config . renderType === CONST . WEBGL )
6175 {
62- console . log ( 'Creating WEBGL Renderer' ) ;
6376 game . renderer = new WebGLRenderer ( game ) ;
6477 game . context = null ;
6578 }
6679 else
6780 {
68- console . log ( 'Creating Canvas Renderer' ) ;
6981 game . renderer = new CanvasRenderer ( game ) ;
7082 game . context = game . renderer . context ;
7183 }
Original file line number Diff line number Diff line change 11var CHECKSUM = {
2- build : '9a80e320-ea9a -11e6-9ca7-bb7438e31195 '
2+ build : 'b209de10-eaff -11e6-83d3-cdfcfc553d04 '
33} ;
44module . exports = CHECKSUM ;
You can’t perform that action at this time.
0 commit comments