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 {
this.leftArrow.y = -textureL.height / 2;
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 })
.set({ alpha: 1 })
.wait(300)
......@@ -29,12 +50,7 @@ export class HorizontalBgAni extends FYGE.Container {
.to({ x: -50 - 6 }, 1000)
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);
FYGE.Tween.get(this.rightArrow, { loop: true })
.set({ alpha: 1 })
.wait(300)
......@@ -42,44 +58,5 @@ export class HorizontalBgAni extends FYGE.Container {
FYGE.Tween.get(this.rightArrow, { loop: true })
.set({ x: oriX })
.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 {
this.mouseEnable = false;
this.mouseChildren = false;
var textureL: FYGE.Texture = RES.getRes("leftArrow.png")
this.upArrow = new FYGE.Sprite(textureL);
this.upArrow.rotation = 90;
this.upArrow.x = textureL.height / 2;
this.upArrow.y = -50;
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")
this.downArrow = new FYGE.Sprite(textureR);
......@@ -38,52 +29,35 @@ export class VerticalBgAni extends FYGE.Container {
this.downArrow.y = oriY;
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.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++
}
this.addTweens()
}
/**
* 重置
*/
reset() {
// this.showImage.scaleX = this.showImage.scaleY = 0.7;
// this.showImage.alpha = 1;
// this.direction = true;
// this.count = 0;
FYGE.Tween.removeTweens(this.upArrow);
FYGE.Tween.removeTweens(this.downArrow);
this.addTweens();
}
// var textureL: FYGE.Texture = RES.getRes("leftArrow.png")
// var textureR: FYGE.Texture = RES.getRes("rightArrow.png")
// this.upArrow.x = textureL.width / 2 + 1;
// this.upArrow.y = -45
// this.downArrow.x = textureR.width / 2 + 1;
// this.downArrow.y = 45 - textureR.height;
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 textureR: FYGE.Texture = RES.getRes("rightArrow.png");
var oriY = 50 - textureR.width;
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)
}
}
\ No newline at end of file
......@@ -14,9 +14,12 @@ export class GameToast extends FYGE.Sprite {
FYGE.Tween.removeTweens(this)
this.scaleX = 0.1;
this.scaleY = 0.1;
this.alpha = 1;
FYGE.Tween.get(this)
.to({ scaleX: 1, scaleY: 1 }, 1/3*1000, FYGE.Ease.backOut)
.wait(1/3*1000)
.to({ scaleX: 1.1, scaleY: 1.1 }, 200/2)
.to({ scaleX: 1, scaleY: 1 }, 200/2)
.wait(700/2)
.to({ alpha: 0 }, 200/2)
.call(() => {
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