mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
fixes initial level positioning
This commit is contained in:
parent
aaa1db4468
commit
cad112419d
14 changed files with 91 additions and 61 deletions
|
|
@ -12,6 +12,10 @@ function (Parent, Settings, Nc, PIXI, AbstractLayer) {
|
|||
|
||||
function Level (uid, engine, gameObjects) {
|
||||
Parent.call(this, uid, engine, gameObjects);
|
||||
this.levelSize = {
|
||||
width: 0,
|
||||
height: 0
|
||||
}
|
||||
}
|
||||
|
||||
Level.prototype = Object.create(Parent.prototype);
|
||||
|
|
@ -112,7 +116,16 @@ function (Parent, Settings, Nc, PIXI, AbstractLayer) {
|
|||
if (options.properties && options.properties.parallaxSpeed) {
|
||||
parallaxSpeed = parseFloat(options.properties.parallaxSpeed);
|
||||
}
|
||||
Nc.trigger(Nc.ns.client.view.layer.createAndInsert, options.layerId, parallaxSpeed, behind, referenceId);
|
||||
Nc.trigger(
|
||||
Nc.ns.client.view.layer.createAndInsert,
|
||||
options.layerId,
|
||||
{
|
||||
parallaxSpeed: parallaxSpeed,
|
||||
levelSize: this.levelSize
|
||||
},
|
||||
behind,
|
||||
referenceId
|
||||
);
|
||||
};
|
||||
|
||||
return Level;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue