var EHDI = EHDI || Object.create(null);

EHDI.debugUtils = EHDI.debugUtils || Object.create(null);

EHDI.debugUtils.debugUtilsContainer = function(version) {
    EHDI.aka.Container.call(this);
    
    var fpsDisplay  = new EHDI.debugUtils.FPSDisplay();
    fpsDisplay.anchor.y = 1;
    fpsDisplay.position.set(0, EHDI.GAME.sceneManager.getStageHeight());
    this.addChild(fpsDisplay);
    
    var versionDisplay = new EHDI.aka.PixiText(version, {fontFamily: 'sans-serif', fill: 0xFFFFFF, dropShadow : true, fontSize: 32});
    versionDisplay.anchor.x = 1;
    versionDisplay.anchor.y = 1;
    versionDisplay.position.set(EHDI.GAME.sceneManager.getStageWidth(), EHDI.GAME.sceneManager.getStageHeight());
    
    this.addChild(versionDisplay);
    
    
};

EHDI.debugUtils.debugUtilsContainer.prototype = Object.create(EHDI.aka.Container.prototype);

EHDI.debugUtils.FPSDisplay = function() {
    this.fps = EHDI.GAME.updateManager.getFPS();
    EHDI.aka.PixiText.call(this, "FPS : " + this.fps, {fontFamily: 'sans-serif', fill: 0xFFFFFF, dropShadow : true, fontSize: 32});
    
    EHDI.GAME.updateManager.addFrameListener(this.updateMe.bind(this));
};

EHDI.debugUtils.FPSDisplay.prototype = Object.create(EHDI.aka.PixiText.prototype);

EHDI.debugUtils.FPSDisplay.prototype.updateMe = function() {
    if(this.fps !== EHDI.GAME.updateManager.getFPS())
        this.text = "FPS :" + EHDI.GAME.updateManager.getFPS();
};