如何学习在Cocos内写web视窗/web button?

请问,如果我想在cocos内写原生视窗有没有一些相关的方向可以提供建议

我目前有找到网路上有人写这个可以在画面左下角开twitter的视窗,不过不太清楚要怎么条width跟height

再来我主要是用TS来写,所以真的有点看不太理解要怎么转换,

希望能给些方向,或是TS的范例让小弟我学习学习,谢谢

我主要就是想要个原生视窗 按了可以呼叫cocos内的东西(应该是点下去会用cc.game.emit)

以便我可以在我的游戏内做一些开发者模式快速debug之类的

自顶一个有人知道吗?

图中的代码应该是web 端不是原生的

原来如此,已修改主题,谢谢

也想问问对这方面有相关的范例或建议吗

const {ccclass, property} = cc._decorator;

@ccclass
export default class NewClass extends cc.Component {

html_HelloWorld : HTMLElement;

onLoad () {
    this.createRoot();
}

createRoot() {
    this.html_HelloWorld = document.createElement("div");
    this.html_HelloWorld.style.backgroundColor = "#fafbd8";
    this.html_HelloWorld.style.opacity = "0.8";
    this.html_HelloWorld.style.position = "absolute";
    this.html_HelloWorld.style.left = "10px";
    this.html_HelloWorld.style.width="200px";
    this.html_HelloWorld.style.height="200px";
    this.html_HelloWorld.style.top= "35px";
    this.html_HelloWorld.style.overflow = "auto";
    this.html_HelloWorld.style.padding = "5px";
    this.html_HelloWorld.textContent = "Hello World"
    document.body.appendChild(this.html_HelloWorld);
}

}