
                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/__qc_index__.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}
require('./assets/Script/Helloworld');
require('./assets/Script/TextureCamera');

                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/Helloworld.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, 'e1b90/rohdEk4SdmmEZANaD', 'Helloworld');
// Script/Helloworld.ts

"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
var TextureCamera_1 = require("./TextureCamera");
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var Helloworld = /** @class */ (function (_super) {
    __extends(Helloworld, _super);
    function Helloworld() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    Helloworld.prototype.start = function () {
        var board = this.node.getChildByName("board");
        var tex2D = TextureCamera_1.TextureCamera.getInstance().GenerateTexture(cc.instantiate(board));
        var capturenode = this.node.getChildByName("capturenode");
        var sf = new cc.SpriteFrame(tex2D);
        capturenode.getComponent(cc.Sprite).spriteFrame = sf;
        var restart = this.node.getChildByName("restart");
        restart.on(cc.Node.EventType.TOUCH_END, function () {
            cc.game.restart();
        });
    };
    Helloworld = __decorate([
        ccclass
    ], Helloworld);
    return Helloworld;
}(cc.Component));
exports.default = Helloworld;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFzc2V0cy9TY3JpcHQvSGVsbG93b3JsZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFBQSxpREFBZ0Q7QUFFMUMsSUFBQSxLQUF3QixFQUFFLENBQUMsVUFBVSxFQUFuQyxPQUFPLGFBQUEsRUFBRSxRQUFRLGNBQWtCLENBQUM7QUFHNUM7SUFBd0MsOEJBQVk7SUFBcEQ7O0lBWUEsQ0FBQztJQVhHLDBCQUFLLEdBQUw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nR5IH0gPSBjYy5fZGVjb3JhdG9yO1xyXG5cclxuQGNjY2xhc3NcclxuZXhwb3J0IGRlZmF1bHQgY2xhc3MgSGVsbG93b3JsZCBleHRlbmRzIGNjLkNvbXBvbmVudCB7XHJcbiAgICBzdGFydCgpIHtcclxuICAgICAgICBsZXQgYm9hcmQ6IGNjLk5vZGUgPSB0aGlzLm5vZGUuZ2V0Q2hpbGRCeU5hbWUoXCJib2FyZFwiKTtcclxuICAgICAgICBsZXQgdGV4MkQgPSBUZXh0dXJlQ2FtZXJhLmdldEluc3RhbmNlKCkuR2VuZXJhdGVUZXh0dXJlKGNjLmluc3RhbnRpYXRlKGJvYXJkKSk7XHJcbiAgICAgICAgbGV0IGNhcHR1cmVub2RlID0gdGhpcy5ub2RlLmdldENoaWxkQnlOYW1lKFwiY2FwdHVyZW5vZGVcIik7XHJcbiAgICAgICAgbGV0IHNmID0gbmV3IGNjLlNwcml0ZUZyYW1lKHRleDJEKTtcclxuICAgICAgICBjYXB0dXJlbm9kZS5nZXRDb21wb25lbnQoY2MuU3ByaXRlKS5zcHJpdGVGcmFtZSA9IHNmO1xyXG4gICAgICAgIGxldCByZXN0YXJ0OiBjYy5Ob2RlID0gdGhpcy5ub2RlLmdldENoaWxkQnlOYW1lKFwicmVzdGFydFwiKTtcclxuICAgICAgICByZXN0YXJ0Lm9uKGNjLk5vZGUuRXZlbnRUeXBlLlRPVUNIX0VORCwgKCkgPT4ge1xyXG4gICAgICAgICAgICBjYy5nYW1lLnJlc3RhcnQoKTtcclxuICAgICAgICB9KTtcclxuICAgIH1cclxufVxyXG4iXX0=
//------QC-SOURCE-SPLIT------

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/Script/TextureCamera.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, 'ce683R+qLtIW6ngub7H1pCh', 'TextureCamera');
// Script/TextureCamera.ts

"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.TextureCamera = void 0;
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var TextureCamera = /** @class */ (function (_super) {
    __extends(TextureCamera, _super);
    function TextureCamera() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.textureCamera = null;
        return _this;
    }
    TextureCamera_1 = TextureCamera;
    TextureCamera.getInstance = function () {
        return this._instance;
    };
    TextureCamera.prototype.onLoad = function () {
        this.canvas = cc.find("Canvas");
        this.textureCamera = this.node.getComponent(cc.Camera);
        TextureCamera_1._instance = this;
    };
    TextureCamera.prototype.GenerateTexture = function (target) {
        var width = target.width;
        var height = target.height;
        // 挂载
        target.group = "TextureCapture";
        target.setPosition(cc.Vec2.ZERO);
        target.parent = this.canvas;
        // 生成纹理
        var texture = new cc.RenderTexture;
        texture.initWithSize(width, height);
        this.textureCamera.targetTexture = texture;
        this.textureCamera.render(target);
        // 卸载
        target.group = "default";
        target.parent = null;
        target.destroy();
        target = null;
        // 翻转
        var data = texture.readPixels();
        var length = data.length;
        var data2 = new Uint8Array(length);
        for (var i = 0; i < length; i++) {
            var row02 = parseInt(i / (4 * width) + "");
            var row01 = height - row02 - 1;
            var index = row01 * width * 4 + i % (4 * width);
            data2[i] = data[index];
        }
        var tex = new cc.RenderTexture();
        tex.initWithData(data2, texture.getPixelFormat(), width, height);
        //texture.destroy();
        return tex;
    };
    var TextureCamera_1;
    TextureCamera._instance = null;
    TextureCamera = TextureCamera_1 = __decorate([
        ccclass
    ], TextureCamera);
    return TextureCamera;
}(cc.Component));
exports.TextureCamera = TextureCamera;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64, 
//------QC-SOURCE-SPLIT------
