import { _decorator, Component, director, Node, Sprite, tween, Vec3, Widget } from 'cc';
import { AudioMgr } from './AudioMgr';
import { Clips } from './Enums';
import { AdManger } from './ad/AdManger';
const { ccclass, property } = _decorator;

@ccclass('BasePage')
export class BasePage extends Component {

    start() {
        this.node.setPosition(0, -2200);
        
    }
    update(deltaTime: number) {
    }
    /**
     * show menu panel
     */
    open() {
        this.node.active = true;
        this.node.setPosition(0, 0);
        if(this.node.getComponent(Widget)){
            this.node.getComponent(Widget).right = 0;
            this.node.getComponent(Widget).left = 0;
            this.node.getComponent(Widget).top = 0;
            this.node.getComponent(Widget).bottom = 0;  
        }
    }

    close() {
        AudioMgr.ins.playSound(Clips.btn_1);
        this.node.setPosition(-1000, 0);
        this.node.active = false;
    }

}

