import { _decorator, Component, Node, screen } from 'cc';
const { ccclass, property } = _decorator;

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

    protected onLoad(): void {
        // screen.on("window-resize", () => {

        //     this.scheduleOnce(() => {
        //         console.log("real height:", screen.windowSize.height)
        //     }, 0)
        // }, this);

        window.addEventListener("focusin", (e) => {
            console.log("获得焦点", e.target);
        });

        window.addEventListener("focusout", (e) => {
            console.log("失去焦点", e.target);
        });

    }
    start() {

    }

    update(deltaTime: number) {

    }
}


