import { _decorator, Component, View, UITransform, log, view, screen } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('Start')
export class Start extends Component {
    start() {
        let ViewSize = View.instance.getVisibleSize();
        let WinSize = screen.windowSize;

        const uiTransform = this.getComponent(UITransform);
        uiTransform.setContentSize(ViewSize.width, ViewSize.height);
        uiTransform.setAnchorPoint(0, 1);

        const parentTrans = this.node.parent.getComponent(UITransform);
        this.node.setPosition(-parentTrans.width * parentTrans.anchorX, parentTrans.height * (1-parentTrans.anchorY));
        
        //log("window: "+ WinSize.width +", "+ WinSize.height + " scalex:"+View.instance.getScaleX());
        //log("view: "+ ViewSize.width + ", "+ViewSize.height);
        //log(parentTrans.name + parentTrans.anchorX + ", y:" +parentTrans.anchorY)
    }
}
