From 0072f0e6b5860e29769275e0f133086f30f8ec37 Mon Sep 17 00:00:00 2001 From: logsol Date: Fri, 17 Jan 2014 02:13:59 +0100 Subject: [PATCH] Chuck.js Now all new with WEB_GL ! haha stupid config typo! arrgh --- app/Game/Client/View/Views/PixiView.js | 17 +++++++++++++++-- app/Game/Config/Settings.js | 4 ++-- app/Lib/Vendor/Pixi.js | 2 +- app/Lib/Vendor/Pixi/pixi.dev.js | 16 ++++++++-------- 4 files changed, 26 insertions(+), 13 deletions(-) diff --git a/app/Game/Client/View/Views/PixiView.js b/app/Game/Client/View/Views/PixiView.js index 538044e..a0b74e2 100755 --- a/app/Game/Client/View/Views/PixiView.js +++ b/app/Game/Client/View/Views/PixiView.js @@ -17,6 +17,7 @@ function (Parent, DomController, PIXI, Settings, NotificationCenter) { this.stage = null; this.container = null; this.init(); + this.pixi = PIXI; } PixiView.prototype = Object.create(Parent.prototype); @@ -25,14 +26,25 @@ function (Parent, DomController, PIXI, Settings, NotificationCenter) { if(Settings.USE_WEBGL) { this.renderer = new PIXI.WebGLRenderer(Settings.STAGE_WIDTH, Settings.STAGE_HEIGHT); + console.log('WebGLRenderer') } else { this.renderer = new PIXI.CanvasRenderer(Settings.STAGE_WIDTH, Settings.STAGE_HEIGHT); + console.log('CanvasRenderer') } - this.stage = stage = new PIXI.Stage(0x333333); - + this.stage = new PIXI.Stage(0x333333); + this.initCamera(); + /* + var blurFilter = new PIXI.BlurFilter(); + blurFilter.blurX = 12; + blurFilter.blurY = 0; + var grayFilter = new PIXI.GrayFilter(); + grayFilter.gray = .6; + this.stage.filters = [grayFilter]; + */ + this.setCanvas(this.renderer.view); } @@ -106,6 +118,7 @@ function (Parent, DomController, PIXI, Settings, NotificationCenter) { } PixiView.prototype.initCamera = function () { + this.container = new PIXI.DisplayObjectContainer(); this.stage.addChild(this.container); } diff --git a/app/Game/Config/Settings.js b/app/Game/Config/Settings.js index 5c38de0..5b6ddf0 100755 --- a/app/Game/Config/Settings.js +++ b/app/Game/Config/Settings.js @@ -17,7 +17,7 @@ define({ GRAPHICS_SUBPATH_TILES: 'Tiles/', RATIO: 21, //35 - TILE_SIZE: 65, //15, 25 is original picture + TILE_SIZE: 15, //15, 25 is original picture CAMERA_IS_ORTHOGRAPHIC: true, VIEW_CONTROLLER: 0 ? 'Three' : 'Pixi', @@ -45,7 +45,7 @@ define({ // BROWSER CANVAS_DOM_ID: 'canvasContainer', IS_BROWSER_ENVIRONMENT: typeof window !== 'undefined', - USE_WEGBL: true, + USE_WEBGL: true, // NETWORKING WORLD_UPDATE_BROADCAST_INTERVAL: 70, diff --git a/app/Lib/Vendor/Pixi.js b/app/Lib/Vendor/Pixi.js index 38b9f0a..504f471 100755 --- a/app/Lib/Vendor/Pixi.js +++ b/app/Lib/Vendor/Pixi.js @@ -1,3 +1,3 @@ -define(["Lib/Vendor/Pixi/pixi.dev"], function() { +define(["Lib/Vendor/Pixi/pixi.dev"], function(PIXI) { return PIXI; }) \ No newline at end of file diff --git a/app/Lib/Vendor/Pixi/pixi.dev.js b/app/Lib/Vendor/Pixi/pixi.dev.js index cc5c47f..1ef2227 100755 --- a/app/Lib/Vendor/Pixi/pixi.dev.js +++ b/app/Lib/Vendor/Pixi/pixi.dev.js @@ -2047,10 +2047,10 @@ PIXI.MovieClip.prototype.constructor = PIXI.MovieClip; * @readOnly */ Object.defineProperty( PIXI.MovieClip.prototype, 'totalFrames', { - get: function() { + get: function() { - return this.textures.length; - } + return this.textures.length; + } }); @@ -3685,11 +3685,11 @@ PIXI.EventTarget = function () { }; - this.removeAllEventListeners = function( type ) { - var a = listeners[type]; - if (a) - a.length = 0; - }; + this.removeAllEventListeners = function( type ) { + var a = listeners[type]; + if (a) + a.length = 0; + }; }; /**