private calcWxGameClubButtonTransform(node: cc.Node, key: NonHomeGameClubEnterKey, type: WxGameClubType) {
let size: cc.Size = node.getContentSize();
let worldPosition: cc.Vec2 = node.parent.convertToWorldSpaceAR(node.getPosition());
let x = worldPosition.x * platformApi.screenWidth / cc.winSize.width;
let y = worldPosition.y * platformApi.screenHeight / cc.winSize.height;
let width = size.width * this.alertNode.scale * platformApi.screenWidth / cc.winSize.width;
let height = size.height * this.alertNode.scale * platformApi.screenHeight / cc.winSize.height;
platformApi.showNonHomeGameClubButton(key, type, null, x - width / 2, platformApi.screenHeight - y - height / 2, width, height);
}
根据cocos节点的位置和大小生成微信游戏圈入口按钮
最新推荐文章于 2023-08-03 17:27:22 发布