新增sceneTransition 用于场景过渡

This commit is contained in:
YHH
2020-06-21 10:27:15 +08:00
parent 60646edd6b
commit 3d9730d956
22 changed files with 2292 additions and 226 deletions

View File

@@ -0,0 +1,33 @@
///<reference path="./SceneTransition.ts"/>
class FadeTransition extends SceneTransition {
public fadeToColor: number = 0x000000;
public fadeOutDuration = 0.4;
private _color: number = 0xFFFFFF;
private _toColor: number = 0xFFFFFF;
private _destinationRect: Rectangle;
private _overlayTexture: egret.RenderTexture;
constructor(sceneLoadAction: Function){
super(sceneLoadAction, true);
this._destinationRect = new Rectangle(0, 0, this.previousSceneRender.textureWidth, this.previousSceneRender.textureHeight);
}
// public onBeginTransition(){
// this._overlayTexture = new egret.RenderTexture();
// let shape = new egret.Shape();
// shape.graphics.beginFill(0xFFFFFF, 1);
// shape.graphics.drawRect(0, 0, 1, 1);
// shape.graphics.endFill();
// this._overlayTexture.drawToTexture(shape);
// let elapsed = 0;
// let _toColor;
// while (elapsed < this.fadeOutDuration){
// elapsed += Time.deltaTime;
// // egret.Tween.get(this).to({_color: this._toColor, })
// }
// }
}