mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 18:47:35 +00:00
updated pixi to v2
This commit is contained in:
parent
072e984215
commit
f02230c50c
95 changed files with 44677 additions and 3522 deletions
|
|
@ -125,11 +125,15 @@ function (Parent, Settings, Nc, Exception, ColorConverter, Layer) {
|
|||
Nc.trigger(Nc.ns.client.view.animatedMesh.create, this.layerId, texturePaths, callback, {
|
||||
visible: false,
|
||||
pivot: {
|
||||
x: 35/2 * 4,
|
||||
x: 0,
|
||||
y: 40 * 4
|
||||
},
|
||||
width: 35,
|
||||
height: 40
|
||||
height: 40,
|
||||
anchor: {
|
||||
x: 0.5,
|
||||
y: 0
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -148,7 +152,11 @@ function (Parent, Settings, Nc, Exception, ColorConverter, Layer) {
|
|||
y: 12
|
||||
},
|
||||
width: 10,
|
||||
height: 12
|
||||
height: 12,
|
||||
anchor: {
|
||||
x: 0,
|
||||
y: 0
|
||||
}
|
||||
});
|
||||
|
||||
// Holding arm
|
||||
|
|
@ -162,11 +170,16 @@ function (Parent, Settings, Nc, Exception, ColorConverter, Layer) {
|
|||
Nc.trigger(Nc.ns.client.view.mesh.create, this.layerId, texturePath, callback, {
|
||||
visible: false,
|
||||
pivot: {
|
||||
x: 35/2 * 4,
|
||||
//x: 35/2 * 4,
|
||||
x: 0,
|
||||
y: 40 * 4
|
||||
},
|
||||
width: 35,
|
||||
height: 40
|
||||
height: 40,
|
||||
anchor: {
|
||||
x: 0.5,
|
||||
y: 0
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ function (Parent, PIXI, ColorRangeReplaceFilter, Settings) {
|
|||
var texture = PIXI.Texture.fromImage(texturePaths[i]);
|
||||
texture.width = options.width;
|
||||
texture.height = options.height;
|
||||
PIXI.texturesToUpdate.push(texture);
|
||||
//PIXI.texturesToUpdate.push(texture);
|
||||
textures.push(texture);
|
||||
}
|
||||
|
||||
|
|
@ -85,6 +85,7 @@ function (Parent, PIXI, ColorRangeReplaceFilter, Settings) {
|
|||
if (options.yScale) mesh.scale.y = options.yScale;
|
||||
if (options.visible === true || options.visible === false) mesh.visible = options.visible;
|
||||
if (options.pivot) mesh.pivot = new PIXI.Point(options.pivot.x, options.pivot.y);
|
||||
if (options.anchor) mesh.anchor = options.anchor;
|
||||
};
|
||||
|
||||
Layer.prototype.addFilter = function(mesh, filterName, options) {
|
||||
|
|
|
|||
|
|
@ -33,16 +33,23 @@ function (Parent, DomController, PIXI, Settings, Nc, Exception, GameStats, Layer
|
|||
|
||||
PixiView.prototype.init = function () {
|
||||
|
||||
var transparent = false;
|
||||
var antialias = true;
|
||||
var canvas = DomController.getCanvas();
|
||||
var rendererOptions = {
|
||||
view: DomController.getCanvas(),
|
||||
antialiasing: true,
|
||||
transparent: false,
|
||||
resolution: 1
|
||||
}
|
||||
|
||||
if(Settings.USE_WEBGL) {
|
||||
this.renderer = new PIXI.WebGLRenderer(Settings.STAGE_WIDTH, Settings.STAGE_HEIGHT, canvas, transparent, antialias);
|
||||
console.log('WebGLRenderer')
|
||||
|
||||
this.renderer = new PIXI.WebGLRenderer(Settings.STAGE_WIDTH, Settings.STAGE_HEIGHT, rendererOptions);
|
||||
console.log('WebGLRenderer');
|
||||
|
||||
} else {
|
||||
this.renderer = new PIXI.CanvasRenderer(Settings.STAGE_WIDTH, Settings.STAGE_HEIGHT, canvas, transparent, antialias);
|
||||
console.log('CanvasRenderer - not using WebGL!')
|
||||
|
||||
this.renderer = new PIXI.CanvasRenderer(Settings.STAGE_WIDTH, Settings.STAGE_HEIGHT, rendererOptions);
|
||||
console.warn('CanvasRenderer - not using WebGL!');
|
||||
|
||||
}
|
||||
|
||||
this.stage = new PIXI.Stage(0x333333);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue