mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
fixed fullscreen swiper
This commit is contained in:
parent
af0fb2ef6e
commit
b152053d18
3 changed files with 13 additions and 9 deletions
|
|
@ -21,6 +21,7 @@ function (Parent, PIXI, ColorRangeReplaceFilter, Settings) {
|
|||
this.container = new PIXI.DisplayObjectContainer();
|
||||
this.container.x = 0;
|
||||
this.container.y = 0;
|
||||
this.static = false;
|
||||
}
|
||||
|
||||
Layer.prototype = Object.create(Parent.prototype);
|
||||
|
|
@ -166,13 +167,15 @@ function (Parent, PIXI, ColorRangeReplaceFilter, Settings) {
|
|||
this.container.scale.y = this.container.scale.x;
|
||||
|
||||
// Position
|
||||
var posXStep = (this.position.target.x - this.position.current.x) * Settings.CAMERA_GLIDE / 100;
|
||||
this.position.current.x += posXStep;
|
||||
this.container.x = this.position.current.x + (this.position.current.x * this.parallaxSpeed);
|
||||
if (!this.static) {
|
||||
var posXStep = (this.position.target.x - this.position.current.x) * Settings.CAMERA_GLIDE / 100;
|
||||
this.position.current.x += posXStep;
|
||||
this.container.x = this.position.current.x + (this.position.current.x * this.parallaxSpeed);
|
||||
|
||||
var posYStep = (this.position.target.y - this.position.current.y) * Settings.CAMERA_GLIDE / 100;
|
||||
this.position.current.y += posYStep;
|
||||
this.container.y = this.position.current.y + (this.position.current.y * this.parallaxSpeed);
|
||||
var posYStep = (this.position.target.y - this.position.current.y) * Settings.CAMERA_GLIDE / 100;
|
||||
this.position.current.y += posYStep;
|
||||
this.container.y = this.position.current.y + (this.position.current.y * this.parallaxSpeed);
|
||||
}
|
||||
};
|
||||
|
||||
return Layer;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue