123456789101112131415161718192021 |
- 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));
-
-
-
-
- }
- }
|