mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
working paralax (not for zoom)
This commit is contained in:
parent
357ef181d9
commit
85867f92af
10 changed files with 117 additions and 15 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue