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 = new PIXI.DisplayObjectContainer();
|
||||||
this.container.x = 0;
|
this.container.x = 0;
|
||||||
this.container.y = 0;
|
this.container.y = 0;
|
||||||
|
this.static = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Layer.prototype = Object.create(Parent.prototype);
|
Layer.prototype = Object.create(Parent.prototype);
|
||||||
|
|
@ -166,6 +167,7 @@ function (Parent, PIXI, ColorRangeReplaceFilter, Settings) {
|
||||||
this.container.scale.y = this.container.scale.x;
|
this.container.scale.y = this.container.scale.x;
|
||||||
|
|
||||||
// Position
|
// Position
|
||||||
|
if (!this.static) {
|
||||||
var posXStep = (this.position.target.x - this.position.current.x) * Settings.CAMERA_GLIDE / 100;
|
var posXStep = (this.position.target.x - this.position.current.x) * Settings.CAMERA_GLIDE / 100;
|
||||||
this.position.current.x += posXStep;
|
this.position.current.x += posXStep;
|
||||||
this.container.x = this.position.current.x + (this.position.current.x * this.parallaxSpeed);
|
this.container.x = this.position.current.x + (this.position.current.x * this.parallaxSpeed);
|
||||||
|
|
@ -173,6 +175,7 @@ function (Parent, PIXI, ColorRangeReplaceFilter, Settings) {
|
||||||
var posYStep = (this.position.target.y - this.position.current.y) * Settings.CAMERA_GLIDE / 100;
|
var posYStep = (this.position.target.y - this.position.current.y) * Settings.CAMERA_GLIDE / 100;
|
||||||
this.position.current.y += posYStep;
|
this.position.current.y += posYStep;
|
||||||
this.container.y = this.position.current.y + (this.position.current.y * this.parallaxSpeed);
|
this.container.y = this.position.current.y + (this.position.current.y * this.parallaxSpeed);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return Layer;
|
return Layer;
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,9 @@ define([
|
||||||
function (Parent, PIXI, Nc, Settings) {
|
function (Parent, PIXI, Nc, Settings) {
|
||||||
|
|
||||||
function Swiper() {
|
function Swiper() {
|
||||||
Parent.call(this, "ghost", 0);
|
Parent.call(this, "swiper", 0);
|
||||||
|
|
||||||
|
this.static = true;
|
||||||
|
|
||||||
this.ncTokens = [
|
this.ncTokens = [
|
||||||
Nc.on(Nc.ns.client.view.swiper.swipe, this.swipe, this),
|
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.layerManager.insert(this.ghostLayer, false);
|
||||||
|
|
||||||
this.swiperLayer = new Swiper();
|
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 () {
|
PixiView.prototype.render = function () {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue