
var GUIDebugLayer =cc.Class(
{

    // name:'GUIDebugLayer',
    extends: cc.Component,
    debug:null,
    ctor:function () {
        GUIDebugLayer.debug = this;
        this.onInitDebug();
        return true;
    },

    onInitDebug: function () 
    {
        let _size = cc.winSize;
    
        this.debug = new cc.Node('debug'); 
        this.debug.parent = cc.find("Canvas");
        // console.log('this.debug:',this.debug);
        this.debugStr = this.debug.addComponent(cc.Label);
        this.debug.anchorX = 0.5;
        this.debug.anchorY = -1;
        this.debug.setPosition(0,-_size.height*0.5+300);
        this.debugStr.fontSize = 20;
        this.debug.color =  new cc.Color(255, 0, 0, 255);
    
        this.debug.string =  "",
        // 
    
        console.log('size:',_size);

    },

    INFO_MSG:function (str) {
    	this.debugStr.string = str;
        this.debug.color =  new cc.Color(0, 255, 0, 255);
    },
    DEBUG_MSG:function (str) {
        this.debugStr.string = str;
        this.debug.color =  new cc.Color(0, 255, 0, 255);
    },
    ERROR_MSG:function (str) {
        this.debugStr.string = str;
        this.debug.color =  new cc.Color(255, 0, 0, 255);
    },
    WARNING_MSG:function (str) {
        this.debugStr.string = str;
        this.debug.color =  new cc.Color(255, 255, 0, 255);
    }
});
