Compare commits
2 Commits
0825cd453f
...
ea2d779fcb
| Author | SHA1 | Date |
|---|---|---|
|
|
ea2d779fcb | |
|
|
5e658c8847 |
|
|
@ -142,24 +142,81 @@ class Yosin_BaseButton extends Yosin_CommonUi {
|
|||
}
|
||||
|
||||
//三分法拉伸
|
||||
class Yosin_EmeStretch extends Yosin_CommonUi {
|
||||
// class Yosin_EmeStretch extends Yosin_CommonUi {
|
||||
|
||||
// Path = null;
|
||||
// Idx = null;
|
||||
// //按钮状态
|
||||
// SpriteList = null;
|
||||
|
||||
// constructor(X, Y, W, H, Path, Idx, Direction = true) {
|
||||
// this.Path = Path;
|
||||
// this.Idx = Idx;
|
||||
// base.constructor(X, Y, W, H);
|
||||
|
||||
// // 创建画布
|
||||
// local Canvas = CL_CanvasObject();
|
||||
// // 重设大小并清空
|
||||
// Canvas.ResizeAndClear(W, H);
|
||||
// // 开始绘制
|
||||
// Canvas.BeginDraw();
|
||||
|
||||
// SpriteList = [];
|
||||
// SpriteList.push(CL_SpriteObject(Path, Idx));
|
||||
// SpriteList.push(CL_SpriteObject(Path, Idx + 1));
|
||||
// SpriteList.push(CL_SpriteObject(Path, Idx + 2));
|
||||
|
||||
// //横向
|
||||
// if (Direction) {
|
||||
// local ScaleW = (W - SpriteList[0].GetSize().w - SpriteList[2].GetSize().w);
|
||||
// local ScaleRate = ScaleW / SpriteList[1].GetSize().w;
|
||||
|
||||
// SpriteList[1].SetPosition(SpriteList[0].GetSize().w, 0.0);
|
||||
// SpriteList[1].SetScale(ScaleRate, 1.0);
|
||||
// SpriteList[2].SetPosition(SpriteList[0].GetSize().w + ScaleW, 0.0);
|
||||
// }
|
||||
// //纵向
|
||||
// else {
|
||||
// local ScaleH = (H - SpriteList[0].GetSize().h - SpriteList[2].GetSize().h);
|
||||
// local ScaleRate = ScaleH / SpriteList[1].GetSize().h;
|
||||
|
||||
// SpriteList[1].SetPosition(0, SpriteList[0].GetSize().h);
|
||||
// SpriteList[1].SetScale(1.0, ScaleRate);
|
||||
// SpriteList[2].SetPosition(0, SpriteList[0].GetSize().h + ScaleH);
|
||||
// }
|
||||
|
||||
// foreach(Child in SpriteList) {
|
||||
// // Addchild(Child);
|
||||
// Canvas.DrawSprite(Child);
|
||||
// }
|
||||
|
||||
// // 结束绘制
|
||||
// Canvas.EndDraw();
|
||||
// // 添加画布
|
||||
// Addchild(Canvas);
|
||||
|
||||
// }
|
||||
// }
|
||||
|
||||
//三分法拉伸
|
||||
class Yosin_EmeStretch extends CL_CanvasObject {
|
||||
|
||||
Path = null;
|
||||
Idx = null;
|
||||
//按钮状态
|
||||
SpriteList = null;
|
||||
|
||||
constructor(X, Y, W, H, Path, Idx, Direction = true) {
|
||||
constructor( W, H, Path, Idx, Direction = true) {
|
||||
this.Path = Path;
|
||||
this.Idx = Idx;
|
||||
base.constructor(X, Y, W, H);
|
||||
base.constructor();
|
||||
|
||||
// 创建画布
|
||||
local Canvas = CL_CanvasObject();
|
||||
CL_CanvasObject();
|
||||
// 重设大小并清空
|
||||
Canvas.ResizeAndClear(W, H);
|
||||
ResizeAndClear(W, H);
|
||||
// 开始绘制
|
||||
Canvas.BeginDraw();
|
||||
BeginDraw();
|
||||
|
||||
SpriteList = [];
|
||||
SpriteList.push(CL_SpriteObject(Path, Idx));
|
||||
|
|
@ -187,129 +244,20 @@ class Yosin_EmeStretch extends Yosin_CommonUi {
|
|||
|
||||
foreach(Child in SpriteList) {
|
||||
// Addchild(Child);
|
||||
Canvas.DrawSprite(Child);
|
||||
DrawSprite(Child);
|
||||
}
|
||||
|
||||
// 结束绘制
|
||||
Canvas.EndDraw();
|
||||
EndDraw();
|
||||
// 添加画布
|
||||
Addchild(Canvas);
|
||||
// Addchild(Canvas);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 九宫格拉伸
|
||||
function Yosin_NineBoxStretch(width, height, path, imgId) {
|
||||
|
||||
// 创建画布
|
||||
local Canvas = CL_CanvasObject();
|
||||
// 重设大小并清空
|
||||
Canvas.ResizeAndClear(width, height);
|
||||
// 开始绘制
|
||||
Canvas.BeginDraw();
|
||||
|
||||
// 左上角
|
||||
// local backgroundTopLeft = CL_SpriteObject(path, imgId);
|
||||
local backgroundTopLeft = CL_SpriteObject(path, imgId);
|
||||
// 上边
|
||||
local backgroundTop = CL_SpriteObject(path, imgId + 1);
|
||||
// 右上角
|
||||
local backgroundTopRight = CL_SpriteObject(path, imgId + 2);
|
||||
// 左边
|
||||
local backgroundLeft = CL_SpriteObject(path, imgId + 3);
|
||||
// 中间
|
||||
local backgroundCenter = CL_SpriteObject(path, imgId + 4);
|
||||
// 右边
|
||||
local backgroundRight = CL_SpriteObject(path, imgId + 5);
|
||||
// 左下角
|
||||
local backgroundBottomLeft = CL_SpriteObject(path, imgId + 6);
|
||||
// 下边
|
||||
local backgroundBottom = CL_SpriteObject(path, imgId + 7);
|
||||
// 右下角
|
||||
local backgroundBottomRight = CL_SpriteObject(path, imgId + 8);
|
||||
|
||||
|
||||
// 左上角
|
||||
Canvas.DrawSprite(backgroundTopLeft);
|
||||
|
||||
local TopLeftSize = backgroundTopLeft.GetSize();
|
||||
local TopLeftBottom = TopLeftSize.h;
|
||||
local TopLeftRight = TopLeftSize.w;
|
||||
|
||||
// 中间图片大小
|
||||
local centerImgSize = backgroundCenter.GetSize();
|
||||
local centerImgWidth = centerImgSize.w;
|
||||
local centerImgHeight = centerImgSize.h;
|
||||
|
||||
local centerWidth = width - backgroundTopLeft.GetSize().w - backgroundTopRight.GetSize().w;
|
||||
local centerHeight = height - backgroundTopLeft.GetSize().h - backgroundBottomLeft.GetSize().h;
|
||||
|
||||
|
||||
local scaleW = (centerWidth - 1).tofloat() / centerImgWidth.tofloat();
|
||||
local scaleH = (centerHeight - 1).tofloat() / centerImgHeight.tofloat();
|
||||
|
||||
// 上边
|
||||
backgroundTop.SetScale(scaleW, 1);
|
||||
backgroundTop.SetPosition(TopLeftRight, 0);
|
||||
Canvas.DrawSprite(backgroundTop);
|
||||
|
||||
// 右上角
|
||||
backgroundTopRight.SetPosition(width - backgroundTopRight.GetSize().w - 1, 0);
|
||||
Canvas.DrawSprite(backgroundTopRight);
|
||||
|
||||
// 左边
|
||||
backgroundLeft.SetScale(1, scaleH);
|
||||
backgroundLeft.SetPosition(0, TopLeftBottom);
|
||||
Canvas.DrawSprite(backgroundLeft);
|
||||
|
||||
// 中间
|
||||
backgroundCenter.SetScale(scaleW, scaleH);
|
||||
// Addchild(backgroundCenter);
|
||||
backgroundCenter.SetPosition(TopLeftRight, backgroundLeft.Y);
|
||||
Canvas.DrawSprite(backgroundCenter);
|
||||
|
||||
// 右边
|
||||
backgroundRight.SetScale(1, scaleH);
|
||||
backgroundRight.SetPosition(width - backgroundRight.GetSize().w - 1, backgroundCenter.Y);
|
||||
Canvas.DrawSprite(backgroundRight);
|
||||
|
||||
// 左下角
|
||||
backgroundBottomLeft.SetPosition(0, height - backgroundBottomLeft.GetSize().h - 1);
|
||||
Canvas.DrawSprite(backgroundBottomLeft);
|
||||
|
||||
// 下边
|
||||
backgroundBottom.SetScale(scaleW, 1);
|
||||
backgroundBottom.SetPosition(TopLeftRight, backgroundBottomLeft.Y);
|
||||
Canvas.DrawSprite(backgroundBottom);
|
||||
|
||||
// 右下角
|
||||
backgroundBottomRight.SetPosition(width - backgroundBottomRight.GetSize().w - 1, backgroundBottomLeft.Y);
|
||||
Canvas.DrawSprite(backgroundBottomRight);
|
||||
|
||||
// 结束绘制
|
||||
Canvas.EndDraw();
|
||||
// 添加画布
|
||||
// Addchild(Canvas);
|
||||
local Sp = CL_SpriteObject();
|
||||
Sp.SetFrame(Canvas.ExportSpriteFrame());
|
||||
return Sp;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// //九宫格拉伸
|
||||
// class Yosin_NineBoxStretch extends Yosin_CommonUi {
|
||||
|
||||
// constructor(X, Y, W, H, Path, Idx) {
|
||||
// base.constructor(X, Y, W, H);
|
||||
// DrawBackground(W, H, Path, Idx);
|
||||
// }
|
||||
|
||||
|
||||
// // 绘制
|
||||
// function DrawBackground(width, height, path, imgId) {
|
||||
|
||||
// function Yosin_NineBoxStretch(width, height, path, imgId) {
|
||||
|
||||
// // 创建画布
|
||||
// local Canvas = CL_CanvasObject();
|
||||
|
|
@ -360,50 +308,149 @@ function Yosin_NineBoxStretch(width, height, path, imgId) {
|
|||
|
||||
// // 上边
|
||||
// backgroundTop.SetScale(scaleW, 1);
|
||||
// backgroundTop.SetPosition(TopLeftRight + 1, 0);
|
||||
// backgroundTop.SetPosition(TopLeftRight, 0);
|
||||
// Canvas.DrawSprite(backgroundTop);
|
||||
|
||||
// // 右上角
|
||||
// backgroundTopRight.SetPosition(width - backgroundTopRight.GetSize().w, 0);
|
||||
// backgroundTopRight.SetPosition(width - backgroundTopRight.GetSize().w - 1, 0);
|
||||
// Canvas.DrawSprite(backgroundTopRight);
|
||||
|
||||
// // 左边
|
||||
// backgroundLeft.SetScale(1, scaleH);
|
||||
// backgroundLeft.SetPosition(0, TopLeftBottom + 1);
|
||||
// backgroundLeft.SetPosition(0, TopLeftBottom);
|
||||
// Canvas.DrawSprite(backgroundLeft);
|
||||
|
||||
// // 中间
|
||||
// backgroundCenter.SetScale(scaleW, scaleH);
|
||||
// // Addchild(backgroundCenter);
|
||||
// backgroundCenter.SetPosition(TopLeftRight + 1, backgroundLeft.Y);
|
||||
// backgroundCenter.SetPosition(TopLeftRight, backgroundLeft.Y);
|
||||
// Canvas.DrawSprite(backgroundCenter);
|
||||
|
||||
// // 右边
|
||||
// backgroundRight.SetScale(1, scaleH);
|
||||
// backgroundRight.SetPosition(width - backgroundRight.GetSize().w, backgroundCenter.Y);
|
||||
// backgroundRight.SetPosition(width - backgroundRight.GetSize().w - 1, backgroundCenter.Y);
|
||||
// Canvas.DrawSprite(backgroundRight);
|
||||
|
||||
// // 左下角
|
||||
// backgroundBottomLeft.SetPosition(0, height - backgroundBottomLeft.GetSize().h);
|
||||
// backgroundBottomLeft.SetPosition(0, height - backgroundBottomLeft.GetSize().h - 1);
|
||||
// Canvas.DrawSprite(backgroundBottomLeft);
|
||||
|
||||
// // 下边
|
||||
// backgroundBottom.SetScale(scaleW, 1);
|
||||
// backgroundBottom.SetPosition(TopLeftRight + 1, backgroundBottomLeft.Y);
|
||||
// backgroundBottom.SetPosition(TopLeftRight, backgroundBottomLeft.Y);
|
||||
// Canvas.DrawSprite(backgroundBottom);
|
||||
|
||||
// // 右下角
|
||||
// backgroundBottomRight.SetPosition(width - backgroundBottomRight.GetSize().w, backgroundBottomLeft.Y);
|
||||
// backgroundBottomRight.SetPosition(width - backgroundBottomRight.GetSize().w - 1, backgroundBottomLeft.Y);
|
||||
// Canvas.DrawSprite(backgroundBottomRight);
|
||||
|
||||
// // 结束绘制
|
||||
// Canvas.EndDraw();
|
||||
// // 添加画布
|
||||
// Addchild(Canvas);
|
||||
|
||||
// // Addchild(Canvas);
|
||||
// local Sp = CL_SpriteObject();
|
||||
// Sp.SetFrame(Canvas.ExportSpriteFrame());
|
||||
// return Sp;
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
|
||||
//九宫格拉伸
|
||||
class Yosin_NineBoxStretch extends CL_CanvasObject {
|
||||
|
||||
constructor( width, height, path, imgId) {
|
||||
base.constructor();
|
||||
|
||||
// 创建画布
|
||||
CL_CanvasObject();
|
||||
// 重设大小并清空
|
||||
ResizeAndClear(width, height);
|
||||
|
||||
// 开始绘制
|
||||
BeginDraw();
|
||||
|
||||
// 左上角
|
||||
local backgroundTopLeft = CL_SpriteObject(path, imgId);
|
||||
// 上边
|
||||
local backgroundTop = CL_SpriteObject(path, imgId + 1);
|
||||
// 右上角
|
||||
local backgroundTopRight = CL_SpriteObject(path, imgId + 2);
|
||||
// 左边
|
||||
local backgroundLeft = CL_SpriteObject(path, imgId + 3);
|
||||
// 中间
|
||||
local backgroundCenter = CL_SpriteObject(path, imgId + 4);
|
||||
// 右边
|
||||
local backgroundRight = CL_SpriteObject(path, imgId + 5);
|
||||
// 左下角
|
||||
local backgroundBottomLeft = CL_SpriteObject(path, imgId + 6);
|
||||
// 下边
|
||||
local backgroundBottom = CL_SpriteObject(path, imgId + 7);
|
||||
// 右下角
|
||||
local backgroundBottomRight = CL_SpriteObject(path, imgId + 8);
|
||||
|
||||
|
||||
// 左上角
|
||||
DrawSprite(backgroundTopLeft);
|
||||
|
||||
local TopLeftSize = backgroundTopLeft.GetSize();
|
||||
local TopLeftBottom = TopLeftSize.h;
|
||||
local TopLeftRight = TopLeftSize.w;
|
||||
|
||||
// 中间图片大小
|
||||
local centerImgSize = backgroundCenter.GetSize();
|
||||
local centerImgWidth = centerImgSize.w;
|
||||
local centerImgHeight = centerImgSize.h;
|
||||
|
||||
local centerWidth = width - backgroundTopLeft.GetSize().w - backgroundTopRight.GetSize().w;
|
||||
local centerHeight = height - backgroundTopLeft.GetSize().h - backgroundBottomLeft.GetSize().h;
|
||||
|
||||
|
||||
local scaleW = (centerWidth - 1).tofloat() / centerImgWidth.tofloat();
|
||||
local scaleH = (centerHeight - 1).tofloat() / centerImgHeight.tofloat();
|
||||
|
||||
// 上边
|
||||
backgroundTop.SetScale(scaleW, 1);
|
||||
backgroundTop.SetPosition(TopLeftRight, 0);
|
||||
DrawSprite(backgroundTop);
|
||||
|
||||
// 右上角
|
||||
backgroundTopRight.SetPosition(width - backgroundTopRight.GetSize().w - 1, 0);
|
||||
DrawSprite(backgroundTopRight);
|
||||
|
||||
// 左边
|
||||
backgroundLeft.SetScale(1, scaleH);
|
||||
backgroundLeft.SetPosition(0, TopLeftBottom);
|
||||
DrawSprite(backgroundLeft);
|
||||
|
||||
// 中间
|
||||
backgroundCenter.SetScale(scaleW, scaleH);
|
||||
// Addchild(backgroundCenter);
|
||||
backgroundCenter.SetPosition(TopLeftRight, backgroundLeft.Y);
|
||||
DrawSprite(backgroundCenter);
|
||||
|
||||
// 右边
|
||||
backgroundRight.SetScale(1, scaleH);
|
||||
backgroundRight.SetPosition(width - backgroundRight.GetSize().w - 1, backgroundCenter.Y);
|
||||
DrawSprite(backgroundRight);
|
||||
|
||||
// 左下角
|
||||
backgroundBottomLeft.SetPosition(0, height - backgroundBottomLeft.GetSize().h - 1);
|
||||
DrawSprite(backgroundBottomLeft);
|
||||
|
||||
// 下边
|
||||
backgroundBottom.SetScale(scaleW, 1);
|
||||
backgroundBottom.SetPosition(TopLeftRight, backgroundBottomLeft.Y);
|
||||
DrawSprite(backgroundBottom);
|
||||
|
||||
// 右下角
|
||||
backgroundBottomRight.SetPosition(width - backgroundBottomRight.GetSize().w - 1, backgroundBottomLeft.Y);
|
||||
DrawSprite(backgroundBottomRight);
|
||||
|
||||
// 结束绘制
|
||||
EndDraw();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//拼接按钮
|
||||
class Yosin_SplicingButton extends Yosin_CommonUi {
|
||||
|
|
@ -427,14 +474,14 @@ class Yosin_SplicingButton extends Yosin_CommonUi {
|
|||
SpriteList = array(4);
|
||||
|
||||
//普通态
|
||||
SpriteList[0] = Yosin_EmeStretch(0, 0, W, H, Path, Idx, Direction);
|
||||
SpriteList[0] = Yosin_EmeStretch( W, H, Path, Idx, Direction);
|
||||
//悬停态
|
||||
SpriteList[1] = Yosin_EmeStretch(0, 0, W, H, Path, Idx + (UnavailableFlag ? 4 : 3), Direction);
|
||||
SpriteList[1] = Yosin_EmeStretch( W, H, Path, Idx + (UnavailableFlag ? 4 : 3), Direction);
|
||||
//按下态
|
||||
SpriteList[2] = Yosin_EmeStretch(0, 0, W, H, Path, Idx + (UnavailableFlag ? 8 : 6), Direction);
|
||||
SpriteList[2] = Yosin_EmeStretch( W, H, Path, Idx + (UnavailableFlag ? 8 : 6), Direction);
|
||||
if (UnavailableFlag) {
|
||||
//不可用态
|
||||
SpriteList[3] = Yosin_EmeStretch(0, 0, W, H, Path, Idx + 12, Direction);
|
||||
SpriteList[3] = Yosin_EmeStretch( W, H, Path, Idx + 12, Direction);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -455,7 +502,7 @@ class Yosin_SplicingButton extends Yosin_CommonUi {
|
|||
RemoveUIChild(SpriteList[SpriteState]);
|
||||
}
|
||||
SpriteState = State;
|
||||
AddUIChild(SpriteList[SpriteState]);
|
||||
Addchild(SpriteList[SpriteState]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -588,17 +635,17 @@ class Yosin_StretchTitleButton extends Yosin_CommonUi {
|
|||
SpriteList = array(3);
|
||||
|
||||
//普通态
|
||||
SpriteList[0] = Yosin_EmeStretch(0, 0, W, H, Path, Idx);
|
||||
AddUIChild(SpriteList[0]);
|
||||
SpriteList[0] = Yosin_EmeStretch( W, H, Path, Idx);
|
||||
Addchild(SpriteList[0]);
|
||||
|
||||
//悬停态
|
||||
SpriteList[1] = Yosin_EmeStretch(0, 0, W, H, Path, Idx + 3);
|
||||
SpriteList[1] = Yosin_EmeStretch( W, H, Path, Idx + 3);
|
||||
SpriteList[1].SetVisible(false)
|
||||
AddUIChild(SpriteList[1]);
|
||||
Addchild(SpriteList[1]);
|
||||
//按下态
|
||||
SpriteList[2] = Yosin_EmeStretch(0, 0, W, H, Path, Idx + 6);
|
||||
SpriteList[2] = Yosin_EmeStretch( W, H, Path, Idx + 6);
|
||||
SpriteList[2].SetVisible(false)
|
||||
AddUIChild(SpriteList[2]);
|
||||
Addchild(SpriteList[2]);
|
||||
|
||||
// 文字
|
||||
titleText = FontAssetManager.GenerateNormal(title, true, {
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ function InitGame() {
|
|||
//初始化控制器
|
||||
_GameController_();
|
||||
//初始化顶部工具条UI
|
||||
// Sq_CreateWindow(_Top_tool, "窗口顶部工具条", 208, 0, 650, 20, 0);
|
||||
Sq_CreateWindow(_Top_tool, "窗口顶部工具条", 208, 0, 650, 20, 0);
|
||||
|
||||
//预加载
|
||||
Animation("ui/charactercreate/dust.ani");
|
||||
|
|
|
|||
|
|
@ -21,7 +21,8 @@ class Yosin_TopTitle extends Yosin_CommonUi {
|
|||
// 绘制标题背景
|
||||
local titleX = drawBackground ? 2 : 0;
|
||||
local titleW = drawBackground ? W - 4 : W;
|
||||
local titleBackground = Yosin_EmeStretch(titleX, 0, titleW, 20, "sprite/interface/lenheartwindowcommon.img", 609);
|
||||
local titleBackground = Yosin_EmeStretch( titleW, 20, "sprite/interface/lenheartwindowcommon.img", 609);
|
||||
titleBackground.SetPosition(titleX, 0);
|
||||
titleBackground.SetScale(1, 1.3);
|
||||
Addchild(titleBackground);
|
||||
|
||||
|
|
|
|||
|
|
@ -84,9 +84,9 @@ class _Yosin_MessageBox extends Yosin_Window {
|
|||
Addchild(twoBackground);
|
||||
|
||||
// 绘制标题背景
|
||||
local titleBackground = Yosin_EmeStretch(0, 0, cacheW, 20, "sprite/interface/lenheartwindowcommon.img", 609);
|
||||
local titleBackground = Yosin_EmeStretch(cacheW, 20, "sprite/interface/lenheartwindowcommon.img", 609);
|
||||
titleBackground.SetScale(1, 1.2);
|
||||
AddUIChild(titleBackground);
|
||||
Addchild(titleBackground);
|
||||
|
||||
// 标题背景光
|
||||
local BackgroundBright = CL_SpriteObject("sprite/interface/lenheartwindowcommon.img", 483);
|
||||
|
|
|
|||
|
|
@ -32,10 +32,10 @@ class _Top_tool extends Yosin_Window {
|
|||
}
|
||||
|
||||
function RegisterWidget() {
|
||||
local background = Yosin_EmeStretch(0, 0, 650, 20, "sprite/interface/lenheartwindowcommon.img", 612);
|
||||
local background = Yosin_EmeStretch( 650, 20, "sprite/interface/lenheartwindowcommon.img", 612);
|
||||
Addchild(background);
|
||||
|
||||
local timeBackGround = Yosin_EmeStretch(0, 0, 90, 14, "sprite/interface/lenheartwindowcommon.img", 615);
|
||||
local timeBackGround = Yosin_EmeStretch( 90, 14, "sprite/interface/lenheartwindowcommon.img", 615);
|
||||
timeBackGround.SetPosition(14, 2);
|
||||
Addchild(timeBackGround);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,54 +0,0 @@
|
|||
/*
|
||||
文件名:5_Inventory.nut
|
||||
路径:User/UI/Window/5_Inventory.nut
|
||||
创建日期:2025-01-02 12:37
|
||||
文件用途: 背包窗口
|
||||
*/
|
||||
|
||||
class _Inventory extends Yosin_Window {
|
||||
|
||||
item = null;
|
||||
dressUpTitleBtn = null;
|
||||
petTitleBtn = null;
|
||||
stoneTitleBtn = null;
|
||||
|
||||
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
|
||||
base.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
|
||||
|
||||
local title = Yosin_TopTitle(gWidth, gHeight, "装备栏(I)");
|
||||
AddUIChild(title);
|
||||
|
||||
local item2 = Yosin_EmeStretch(0, 0, 80, 25, "sprite/interface/lenheartwindowcommon.img", 160);
|
||||
item2.SetPos(100, 100);
|
||||
Addchild(item2);
|
||||
|
||||
//注册控件
|
||||
RegisterWidget();
|
||||
}
|
||||
|
||||
function RegisterWidget() {
|
||||
|
||||
//, "装扮", "宠物", "护石"
|
||||
local titlesBtn = Yosin_RowMoreTitleBtn(10, 25, ["物品栏"]);
|
||||
AddUIChild(titlesBtn);
|
||||
|
||||
titlesBtn.LBDownOnClick = function(btns, index) {
|
||||
|
||||
};
|
||||
|
||||
|
||||
local item = Yosin_SplicingButton(10, 50, 80, 25, "sprite/interface/lenheartwindowcommon.img", 160, true, false);
|
||||
AddUIChild(item);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
//逻辑入口
|
||||
function Proc(Dt) {
|
||||
SyncPos(X, Y);
|
||||
base.Proc(Dt);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -21,6 +21,16 @@ class Inventory_DressUpPage extends Yosin_CommonUi {
|
|||
CharactersDressUp.SetPosition(0, 0);
|
||||
Addchild(CharactersDressUp);
|
||||
|
||||
// 镶嵌徽章
|
||||
local InsetBadge = Yosin_BaseButton(150, 137, 97, 22, "sprite/interface/newstyle/windows/inventory/inventory.img", 90);
|
||||
AddUIChild(InsetBadge);
|
||||
|
||||
|
||||
//分页按钮
|
||||
local titlesBtn = Yosin_RowMoreTitleBtn(2, 180, 250, ["装扮", "徽章"], "sprite/interface/lenheartwindowcommon.img", 160);
|
||||
AddUIChild(titlesBtn);
|
||||
|
||||
|
||||
}
|
||||
|
||||
// 添加按钮
|
||||
|
|
@ -74,8 +84,21 @@ class Inventory_CharactersDressUp extends CL_CanvasObject {
|
|||
local CharacterLight = CL_SpriteFrameObject("sprite/interface/newstyle/windows/inventory/inventory.img", 178);
|
||||
DrawSpriteFrame(CharacterLight, -10, 4);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
// if (!getroottable().rawin("chongzaiflag")) {
|
||||
// getroottable()["chongzaiflag"] <- true;
|
||||
// } else {
|
||||
// //遍历窗口队列 如果可见则调用Show
|
||||
// for (local i = 0; i< _SYS_WINDOW_LIST_.len(); i++) {
|
||||
// local Window = _SYS_WINDOW_LIST_[i];
|
||||
// Window.Visible = false;
|
||||
// Window.RemoveSelf();
|
||||
// }
|
||||
// TestStage();
|
||||
// }
|
||||
Loading…
Reference in New Issue