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

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

View File

@@ -0,0 +1,30 @@
/*
文件名:TripleCav.nut
路径:UI/Windows/Widget/TripleCav.nut
创建日期:2025-10-24 23:15
文件用途:三联画布
*/
class GameWidget_TripleCav extends Canvas {
/**
* 创建三联图画布
* @function
* @param {string} ImgPath Img路径
* @param {integer} ImgStart Img起始索引
* @param {integer} Width 总宽度
* @returns {gamewidget_triplecav}
*/
constructor(ImgPath, ImgStart, Width) {
local Left_Width = sq_GetPng(ImgPath, ImgStart).Width;
local Height = sq_GetPng(ImgPath, ImgStart).Height;
local Right_Width = sq_GetPng(ImgPath, ImgStart + 2).Width;
base.constructor(Width, Height);
//绘制左侧
DrawImg(ImgPath, ImgStart, 0, 0);
//绘制中间
DrawImgRect(ImgPath, ImgStart + 1, Left_Width, 0, Width - Left_Width - Right_Width, Height);
//绘制右侧
DrawImg(ImgPath, ImgStart + 2, Width - Right_Width, 0);
}
}