加入文本精灵

This commit is contained in:
2025-10-25 15:51:53 +08:00
parent 77fe539809
commit 89899a3799
9 changed files with 67 additions and 10 deletions

View File

@@ -6,20 +6,33 @@
*/
class Window_NotiBox extends GameWindow {
testvalue = 666;
constructor(Name, gX, gY, gWidth, gHeight, gTitleHeight) {
base.constructor(Name, gX, gY, gWidth, gHeight, gTitleHeight);
InitSprite();
InitButton();
// InitButton();
}
function InitSprite() {
local Sp = Sprite("sprite/hud/newantonui.img", 0);
AddChild(Sp);
local Textobj = Text("测试文本",0,sq_RGBA(255,255,255,255));
AddChild(Textobj);
local Textobj2 = Text("测试文本",1,sq_RGBA(255,255,255,255));
Textobj2.SetPos(0,50);
AddChild(Textobj2);
}
function InitButton() {
local Btn = GameWidget_BaseButton(40, 40, 56, 24, "sprite/interface/lenheartwindowcommon.img", 12);
Btn.OnClick = function(btn){
// print(testvalue);
print(this);
print(btn);
}.bindenv(this);
AddChild(Btn);
}
}