加入文本精灵

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

@@ -65,7 +65,7 @@ class GameWidget extends WindowNode {
local IMouse = Game_Cursor.GetInstance();
local Pos = GetWorldPos();
if (isLBDown && Math.IsIntersectRect(IMouse.MouseX, IMouse.MouseY, 1, 1, Pos.x, Pos.y, Width, Height)) {
if (OnClick) this.OnClick(this);
if (OnClick) this.OnClick.call(this,this);
if (ClickSound) {
//TODO 音效系统
// Sq_PlaySoundEffect(ClickSound);

16
UI/ObjectClass/Text.nut Normal file
View File

@@ -0,0 +1,16 @@
/*
文件名:Text.nut
路径:UI/ObjectClass/Text.nut
创建日期:2025-10-25 15:40
文件用途:
*/
class Text extends Actor {
function _typeof() {
return "Text"
}
constructor(Str, FontIndex,Color) {
C_Object = sq_CreateText(Str, FontIndex, Color);
sq_RegisterDestruction(C_Object,this);
}
}