新增画布类,三联,九宫格控件

This commit is contained in:
2025-10-25 13:42:36 +08:00
parent 5d78244ef0
commit 77fe539809
16 changed files with 953 additions and 9 deletions

24
UI/ObjectClass/Canvas.nut Normal file
View File

@@ -0,0 +1,24 @@
/*
文件名:Canvas.nut
路径:UI/ObjectClass/Canvas.nut
创建日期:2025-10-24 22:00
文件用途:画布类
*/
class Canvas extends Actor {
function _typeof() {
return "Canvas";
}
constructor(Width, Height) {
C_Object = sq_CreateCanvas(Width, Height);
sq_RegisterDestruction(C_Object, this);
}
function DrawImg(Img, Index, X, Y) {
sq_Canvas_DrawImg(C_Object, Img, Index, {x = X, y = Y});
}
function DrawImgRect(Img, Index, X, Y, Width, Height) {
sq_Canvas_DrawImgRect(C_Object, Img, Index, {x = X, y = Y,w = Width, h = Height});
}
}