mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 18:47:35 +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;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,9 @@ define([
|
|||
function (Parent, PIXI, Nc, Settings) {
|
||||
|
||||
function Swiper() {
|
||||
Parent.call(this, "ghost", 0);
|
||||
Parent.call(this, "swiper", 0);
|
||||
|
||||
this.static = true;
|
||||
|
||||
this.ncTokens = [
|
||||
Nc.on(Nc.ns.client.view.swiper.swipe, this.swipe, this),
|
||||
|
|
|
|||
|
|
@ -74,8 +74,7 @@ function (Parent, DomController, PIXI, Settings, Nc, Exception, GameStats, Layer
|
|||
this.layerManager.insert(this.ghostLayer, false);
|
||||
|
||||
this.swiperLayer = new Swiper();
|
||||
this.stage.addChild(this.swiperLayer.getContainer());
|
||||
//this.layerManager.insert(this.swiperLayer, false);
|
||||
this.layerManager.insert(this.swiperLayer, false);
|
||||
}
|
||||
|
||||
PixiView.prototype.render = function () {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue