working paralax (not for zoom)

This commit is contained in:
Jeena 2014-11-15 23:28:03 +01:00
parent 357ef181d9
commit 85867f92af
10 changed files with 117 additions and 15 deletions

View file

@ -90,7 +90,11 @@ function (Parent, Settings, Nc, PIXI, AbstractLayer) {
Level.prototype.setupLayer = function(options, behind, referenceId) {
Parent.prototype.setupLayer.call(this, options, behind, referenceId);
Nc.trigger(Nc.ns.client.view.layer.createAndInsert, options.layerId, 1, behind, referenceId);
var parallaxSpeed = 0.0;
if (options.properties && options.properties.parallaxSpeed) {
parallaxSpeed = parseFloat(options.properties.parallaxSpeed);
}
Nc.trigger(Nc.ns.client.view.layer.createAndInsert, options.layerId, parallaxSpeed, behind, referenceId);
};
return Level;

View file

@ -80,14 +80,19 @@ function (Parent, Settings, Nc) {
pivot: {
x: mesh.texture.width / 2,
y: mesh.texture.height / 2
}
},
xScale: 1,
yScale: 1
});
}
Nc.trigger(Nc.ns.client.view.mesh.create,
options.layerId,
texturePath,
callback
callback,
{
alpha: options.opacity
}
);
}