新增画布类,三联,九宫格控件
This commit is contained in:
24
UI/ObjectClass/Canvas.nut
Normal file
24
UI/ObjectClass/Canvas.nut
Normal 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});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user