Commit ba02d389 authored by wjf's avatar wjf

l

parent b6293615
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -20,6 +20,27 @@ export class HorizontalBgAni extends FYGE.Container { ...@@ -20,6 +20,27 @@ export class HorizontalBgAni extends FYGE.Container {
this.leftArrow.y = -textureL.height / 2; this.leftArrow.y = -textureL.height / 2;
this.addChild(this.leftArrow); this.addChild(this.leftArrow);
var textureR: FYGE.Texture = RES.getRes("rightArrow.png")
this.rightArrow = new FYGE.Sprite(textureR);
var oriX = 50 - textureR.width;
this.rightArrow.x = oriX;
this.rightArrow.y = -textureR.height / 2
this.addChild(this.rightArrow);
this.addTweens();
}
/**
* 重置
*/
reset() {
FYGE.Tween.removeTweens(this.leftArrow);
FYGE.Tween.removeTweens(this.rightArrow);
this.addTweens();
}
private addTweens() {
FYGE.Tween.get(this.leftArrow, { loop: true }) FYGE.Tween.get(this.leftArrow, { loop: true })
.set({ alpha: 1 }) .set({ alpha: 1 })
.wait(300) .wait(300)
...@@ -29,12 +50,7 @@ export class HorizontalBgAni extends FYGE.Container { ...@@ -29,12 +50,7 @@ export class HorizontalBgAni extends FYGE.Container {
.to({ x: -50 - 6 }, 1000) .to({ x: -50 - 6 }, 1000)
var textureR: FYGE.Texture = RES.getRes("rightArrow.png") var textureR: FYGE.Texture = RES.getRes("rightArrow.png")
this.rightArrow = new FYGE.Sprite(textureR);
var oriX = 50 - textureR.width; var oriX = 50 - textureR.width;
this.rightArrow.x = oriX;
this.rightArrow.y = -textureR.height / 2
this.addChild(this.rightArrow);
FYGE.Tween.get(this.rightArrow, { loop: true }) FYGE.Tween.get(this.rightArrow, { loop: true })
.set({ alpha: 1 }) .set({ alpha: 1 })
.wait(300) .wait(300)
...@@ -42,44 +58,5 @@ export class HorizontalBgAni extends FYGE.Container { ...@@ -42,44 +58,5 @@ export class HorizontalBgAni extends FYGE.Container {
FYGE.Tween.get(this.rightArrow, { loop: true }) FYGE.Tween.get(this.rightArrow, { loop: true })
.set({ x: oriX }) .set({ x: oriX })
.to({ x: oriX + 6 }, 1000) .to({ x: oriX + 6 }, 1000)
// this.addEventListener(FYGE.Event.ENTER_FRAME, this.onEnterFrame, this)
}
private onEnterFrame() {
if (this.count >= 10) {
if (this.direction) {
this.leftArrow.x -= this.outSpeed;
this.rightArrow.x += this.outSpeed;
} else {
this.leftArrow.x += this.inSpeed;
this.rightArrow.x -= this.inSpeed;
}
if (this.leftArrow.x < -50) {
this.direction = false;
}
else if (this.leftArrow.x > -45) {
//停住
this.count = 0
this.direction = true;
}
} else {
this.count++
}
}
/**
* 重置
*/
reset() {
// this.showImage.scaleX = this.showImage.scaleY = 0.7;
// this.showImage.alpha = 1;
// this.direction = true;
// this.count = 0;
// var textureL: FYGE.Texture = RES.getRes("leftArrow.png")
// var textureR: FYGE.Texture = RES.getRes("rightArrow.png")
// this.leftArrow.x = -45;
// this.leftArrow.y = -textureL.height / 2;
// this.rightArrow.x = 45 - textureR.width;
// this.rightArrow.y = -textureR.height / 2
} }
} }
\ No newline at end of file
...@@ -14,21 +14,12 @@ export class VerticalBgAni extends FYGE.Container { ...@@ -14,21 +14,12 @@ export class VerticalBgAni extends FYGE.Container {
this.mouseEnable = false; this.mouseEnable = false;
this.mouseChildren = false; this.mouseChildren = false;
var textureL: FYGE.Texture = RES.getRes("leftArrow.png") var textureL: FYGE.Texture = RES.getRes("leftArrow.png")
this.upArrow = new FYGE.Sprite(textureL); this.upArrow = new FYGE.Sprite(textureL);
this.upArrow.rotation = 90; this.upArrow.rotation = 90;
this.upArrow.x = textureL.height / 2; this.upArrow.x = textureL.height / 2;
this.upArrow.y = -50; this.upArrow.y = -50;
this.addChild(this.upArrow); this.addChild(this.upArrow);
FYGE.Tween.get(this.upArrow, { loop: true })
.set({ alpha: 1 })
.wait(300)
.to({ alpha: 0 }, 700)
FYGE.Tween.get(this.upArrow, { loop: true })
.set({ y: -50 })
.to({ y: -50 - 6 }, 1000)
var textureR: FYGE.Texture = RES.getRes("rightArrow.png") var textureR: FYGE.Texture = RES.getRes("rightArrow.png")
this.downArrow = new FYGE.Sprite(textureR); this.downArrow = new FYGE.Sprite(textureR);
...@@ -38,52 +29,35 @@ export class VerticalBgAni extends FYGE.Container { ...@@ -38,52 +29,35 @@ export class VerticalBgAni extends FYGE.Container {
this.downArrow.y = oriY; this.downArrow.y = oriY;
this.addChild(this.downArrow); this.addChild(this.downArrow);
FYGE.Tween.get(this.downArrow, { loop: true })
.set({ alpha: 1 })
.wait(300)
.to({ alpha: 0 }, 700)
FYGE.Tween.get(this.downArrow, { loop: true })
.set({ y: oriY })
.to({ y: oriY + 6 }, 1000)
this.addTweens()
// this.addEventListener(FYGE.Event.ENTER_FRAME, this.onEnterFrame, this)
}
private onEnterFrame() {
if (this.count >= 10) {
if (this.direction) {
this.upArrow.y -= this.outSpeed;
this.downArrow.y += this.outSpeed;
} else {
this.upArrow.y += this.inSpeed;
this.downArrow.y -= this.inSpeed;
}
if (this.upArrow.y < -50) {
this.direction = false;
}
else if (this.upArrow.y > -45) {
//停住
this.count = 0
this.direction = true;
}
} else {
this.count++
}
} }
/** /**
* 重置 * 重置
*/ */
reset() { reset() {
// this.showImage.scaleX = this.showImage.scaleY = 0.7; FYGE.Tween.removeTweens(this.upArrow);
// this.showImage.alpha = 1; FYGE.Tween.removeTweens(this.downArrow);
// this.direction = true; this.addTweens();
// this.count = 0; }
private addTweens() {
FYGE.Tween.get(this.upArrow, { loop: true })
.set({ alpha: 1 })
.wait(300)
.to({ alpha: 0 }, 700)
FYGE.Tween.get(this.upArrow, { loop: true })
.set({ y: -50 })
.to({ y: -50 - 6 }, 1000)
// var textureL: FYGE.Texture = RES.getRes("leftArrow.png") var textureR: FYGE.Texture = RES.getRes("rightArrow.png");
// var textureR: FYGE.Texture = RES.getRes("rightArrow.png") var oriY = 50 - textureR.width;
// this.upArrow.x = textureL.width / 2 + 1; FYGE.Tween.get(this.downArrow, { loop: true })
// this.upArrow.y = -45 .set({ alpha: 1 })
// this.downArrow.x = textureR.width / 2 + 1; .wait(300)
// this.downArrow.y = 45 - textureR.height; .to({ alpha: 0 }, 700)
FYGE.Tween.get(this.downArrow, { loop: true })
.set({ y: oriY })
.to({ y: oriY + 6 }, 1000)
} }
} }
\ No newline at end of file
...@@ -14,9 +14,12 @@ export class GameToast extends FYGE.Sprite { ...@@ -14,9 +14,12 @@ export class GameToast extends FYGE.Sprite {
FYGE.Tween.removeTweens(this) FYGE.Tween.removeTweens(this)
this.scaleX = 0.1; this.scaleX = 0.1;
this.scaleY = 0.1; this.scaleY = 0.1;
this.alpha = 1;
FYGE.Tween.get(this) FYGE.Tween.get(this)
.to({ scaleX: 1, scaleY: 1 }, 1/3*1000, FYGE.Ease.backOut) .to({ scaleX: 1.1, scaleY: 1.1 }, 200/2)
.wait(1/3*1000) .to({ scaleX: 1, scaleY: 1 }, 200/2)
.wait(700/2)
.to({ alpha: 0 }, 200/2)
.call(() => { .call(() => {
callback(); callback();
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment