import Sprite = Laya.Sprite;
export  class GameState
{
    static removeselect:string = "GameState_removeselect";

    

    static npcend:string = "GameState_npcendGame";

    

    /**
     * 通关成功
     */
    static win:string = "GameState_winGame";

    private sp: Sprite;
    private drawSomething(): void {
        this.sp = new Sprite();
        Laya.stage.addChild(this.sp);
        //画线
        this.sp.graphics.drawLine(10, 58, 146, 58, "#ff0000", 3);
        //画连续直线
        this.sp.graphics.drawLines(176, 58, [0, 0, 39, -50, 78, 0, 117, 50, 156, 0], "#ff0000", 5);
        //画曲线
        this.sp.graphics.drawCurves(352, 58, [0, 0, 19, -100, 39, 0, 58, 100, 78, 0, 97, -100, 117, 0, 136, 100, 156, 0], "#ff0000", 5);
        //画矩形
        this.sp.graphics.drawRect(10, 166, 166, 90, "#ffff00");
        //画多边形
        this.sp.graphics.drawPoly(264, 166, [0, 0, 60, 0, 78.48, 57, 30, 93.48, -18.48, 57], "#ffff00");
        //画三角形
        this.sp.graphics.drawPoly(400, 166, [0, 100, 50, 0, 100, 100], "#ffff00");
        //画圆
        this.sp.graphics.drawCircle(98, 332, 50, "#00ffff");
        //画扇形
        this.sp.graphics.drawPie(240, 290, 100, 10, 60, "#00ffff");
        //绘制圆角矩形，自定义路径
        this.sp.graphics.drawPath(400, 310, [["moveTo", 5, 0], ["lineTo", 105, 0], ["arcTo", 110, 0, 110, 5, 5], ["lineTo", 110, 55], ["arcTo", 110, 60, 105, 60, 5], ["lineTo", 5, 60], ["arcTo", 0, 60, 0, 55, 5], ["lineTo", 0, 5], ["arcTo", 0, 0, 5, 0, 5], ["closePath"]], {fillStyle: "#00ffff"});
    }
    /**
     * 通关失败
     */
    static fail:string = "GameState_failGame";

    static jump:string = "GameState_jumpgame";

    /**
     * 暂停游戏
     */
    static stop:string = "GameState_stopGame";

    /**
     * 回到主界面
     */
    static returnMainView:string = "returnMainView";

    static updateSKinView:string = "GameState_updateSKinView";

    /*********************************************************************** */
    private btnArr:Array<string> = ["res/button.png", "res/button.png", "res/button.png"];
    private nameArr:Array<string> = ["canvas截图","sprite截图","清理"];
    private _canvas:HTMLCanvasElement;
    private aimSp:Sprite;
    private drawImage:Laya.Image;
    private drawSp:Sprite;
	private monkeyTexture:Laya.Texture;

    private _onclick(e:Laya.Event){
        switch (e.target.name) {
            case this.nameArr[0]:
                var base64Url:string = this._canvas.toDataURL("image/png",1);
                this.drawImage.skin = base64Url;
                break;
            case this.nameArr[1]:
                var text:Laya.Texture = Laya.stage.drawToTexture(Laya.Browser.clientWidth,Laya.Browser.clientHeight,0,0) as Laya.Texture;
                this.drawSp.graphics.drawTexture(text,0,0,this.drawSp.width,this.drawSp.height);
                break;
            case this.nameArr[2]:
                this.drawImage.skin = null;
                this.drawSp.graphics.clear();
                this.drawSp.graphics.drawRect(0,0,this.drawSp.width,this.drawSp.height,"#ff0000");
                break;
        }
    }
    /*********************************************************************** */
    /**
     * 开始游戏
     */
    static start:string = "GameState_startGame";

    /**
     * 结束游戏
     */
    static end:string = "GameState_endGame";
    
    /**失败 */
    static lose:string = "GameState_loseGame"
    /**
     * 复活
     */
    static revive:string = "GameState_reviveGame";

    /**是否复活 */
    static isdie:boolean = false;

    /**允许复活次数 */
    static fuhuocishu:number = 1;

    /**是否已经发布过录屏 */
    static recordscree:boolean = false;

    /**游戏次数*/
    static GameNum:number = 0;



}