mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 18:47:35 +00:00
more layer work
This commit is contained in:
parent
b5c70687d8
commit
57135f3acc
7 changed files with 54 additions and 31 deletions
|
|
@ -13,15 +13,15 @@ function (Parent, PIXI) {
|
|||
Layer.prototype = Object.create(Parent.prototype);
|
||||
|
||||
Layer.prototype.getContainer = function() {
|
||||
return this.contianer;
|
||||
return this.container;
|
||||
};
|
||||
|
||||
Layer.prototype.show = function() {
|
||||
this.contianer.visible = true;
|
||||
this.container.visible = true;
|
||||
};
|
||||
|
||||
Layer.prototype.hide = function() {
|
||||
this.contianer.visible = false;
|
||||
this.container.visible = false;
|
||||
};
|
||||
|
||||
Layer.prototype.addMesh = function(mesh) {
|
||||
|
|
|
|||
|
|
@ -7,10 +7,10 @@ define([
|
|||
"Lib/Utilities/NotificationCenter",
|
||||
"Lib/Utilities/Exception",
|
||||
"Game/Client/View/Pixi/GameStats",
|
||||
"Game/Client/View/Pixi/Layer"
|
||||
"Game/Client/View/LayerManager",
|
||||
],
|
||||
|
||||
function (Parent, DomController, PIXI, ColorRangeReplaceFilter, Settings, Nc, Exception, GameStats, Layer) {
|
||||
function (Parent, DomController, PIXI, ColorRangeReplaceFilter, Settings, Nc, Exception, GameStats, LayerManager) {
|
||||
|
||||
var AVAILABLE_MESH_FILTERS = {
|
||||
"blur": PIXI.BlurFilter,
|
||||
|
|
@ -23,6 +23,7 @@ function (Parent, DomController, PIXI, ColorRangeReplaceFilter, Settings, Nc, Ex
|
|||
|
||||
Parent.call(this);
|
||||
|
||||
this.layerManager = null;
|
||||
this.movableObjects = [];
|
||||
this.stage = null;
|
||||
this.container = null;
|
||||
|
|
@ -33,7 +34,6 @@ function (Parent, DomController, PIXI, ColorRangeReplaceFilter, Settings, Nc, Ex
|
|||
this.init();
|
||||
this.pixi = PIXI;
|
||||
this.currentZoom = Settings.ZOOM_DEFAULT;
|
||||
this.layers = [];
|
||||
|
||||
PIXI.scaleModes.DEFAULT = PIXI.scaleModes.NEAREST;
|
||||
}
|
||||
|
|
@ -56,6 +56,8 @@ function (Parent, DomController, PIXI, ColorRangeReplaceFilter, Settings, Nc, Ex
|
|||
|
||||
this.stage = new PIXI.Stage(0x333333);
|
||||
|
||||
this.layerManager = new LayerManager(this.stage);
|
||||
|
||||
this.initCamera();
|
||||
this.initLoader();
|
||||
|
||||
|
|
@ -283,6 +285,8 @@ function (Parent, DomController, PIXI, ColorRangeReplaceFilter, Settings, Nc, Ex
|
|||
};
|
||||
|
||||
PixiView.prototype.destroy = function() {
|
||||
|
||||
this.layerManager.destroy();
|
||||
|
||||
for (var i = 0; i < this.stage.children.length; i++) {
|
||||
this.stage.removeChild(this.stage.children[i]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue