parent
ecd1ec694e
commit
f8c7218671
|
|
@ -200,12 +200,10 @@ class Yosin_EmeStretch extends Yosin_CommonUi {
|
|||
|
||||
|
||||
// 九宫格拉伸
|
||||
function Yosin_NineBoxStretch(X, Y, width, height, path, imgId) {
|
||||
|
||||
function Yosin_NineBoxStretch(width, height, path, imgId) {
|
||||
|
||||
// 创建画布
|
||||
local Canvas = CL_CanvasObject();
|
||||
Canvas.SetPosition(X, Y);
|
||||
// 重设大小并清空
|
||||
Canvas.ResizeAndClear(width, height);
|
||||
// 开始绘制
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ class GameItem.EquipmentInfo extends Yosin_Window {
|
|||
|
||||
Init();
|
||||
|
||||
local background = Yosin_NineBoxStretch(0, 0, 211, RealCanvasHeight + 10, "sprite/interface/lenheartwindowcommon.img", 213);
|
||||
local background = Yosin_NineBoxStretch(211, RealCanvasHeight + 10, "sprite/interface/lenheartwindowcommon.img", 213);
|
||||
background.SetZOrder(-1);
|
||||
Addchild(background);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ function TestStage() {
|
|||
// ClientCharacter = Charc;
|
||||
|
||||
|
||||
// local Window = Sq_CreateWindow(_Inventory, "背包窗口", 150, 12, 257, 555, 20);
|
||||
local Window = Sq_CreateWindow(_Inventory, "背包窗口", 150, 12, 257, 548, 20);
|
||||
|
||||
// Window.equipmentPage.Item.ItemCollection.SetItemList([{
|
||||
// ItemId = 27675
|
||||
|
|
|
|||
|
|
@ -13,19 +13,27 @@ class Yosin_TopTitle extends Yosin_CommonUi {
|
|||
|
||||
//内容背景
|
||||
if (drawBackground) {
|
||||
local background = Yosin_NineBoxStretch(0, 15, W + 4, H - 15, "sprite/interface/lenheartwindowcommon.img", 97);
|
||||
local background = Yosin_NineBoxStretch( W, H, "sprite/interface/lenheartwindowcommon.img", 97);
|
||||
background.SetPosition(0, 0);
|
||||
Addchild(background);
|
||||
}
|
||||
|
||||
// 标题背景
|
||||
local Background = Yosin_EmeStretch(0, 0, W + 3, 22, "sprite/interface/lenheartwindowcommon.img", 609);
|
||||
Addchild(Background);
|
||||
// 绘制标题背景
|
||||
local titleX = drawBackground ? 2 : 0;
|
||||
local titleW = drawBackground ? W - 4 : W;
|
||||
local titleBackground = Yosin_EmeStretch(titleX, 0, titleW, 20, "sprite/interface/lenheartwindowcommon.img", 609);
|
||||
titleBackground.SetScale(1, 1.3);
|
||||
Addchild(titleBackground);
|
||||
|
||||
// 标题亮色背景
|
||||
// 标题背景光
|
||||
local BackgroundBright = CL_SpriteObject("sprite/interface/lenheartwindowcommon.img", 483);
|
||||
local scaleW = (Background.GetSize().w / BackgroundBright.GetSize().w).tofloat();
|
||||
local BackgroundBrightSize = BackgroundBright.GetSize();
|
||||
// 计算光的缩放比例
|
||||
local scaleW = (W / BackgroundBrightSize.w).tofloat();
|
||||
print(scaleW);
|
||||
BackgroundBright.SetScale(scaleW, 1);
|
||||
BackgroundBright.SetPosition(0, 1);
|
||||
print(BackgroundBright.X );
|
||||
Addchild(BackgroundBright);
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -549,7 +549,8 @@ class _Select_Character_Window extends Yosin_Window {
|
|||
ChangeBackground(Info.loginImg);
|
||||
|
||||
//角色遮罩栏
|
||||
CharacterMaskBox = Yosin_NineBoxStretch(-4, 320, 1074, 680, "sprite/interface/lenheartwindowcommon.img", 0);
|
||||
CharacterMaskBox = Yosin_NineBoxStretch(1074, 680, "sprite/interface/lenheartwindowcommon.img", 0);
|
||||
CharacterMaskBox.SetPosition(-4, 320);
|
||||
Addchild(CharacterMaskBox);
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -72,19 +72,28 @@ class _Yosin_MessageBox extends Yosin_Window {
|
|||
}
|
||||
|
||||
function RegisterWidget() {
|
||||
|
||||
//背景
|
||||
local background = Yosin_NineBoxStretch(-1, 15, cacheW + 1, cacheH, "sprite/interface/lenheartwindowcommon.img", 97);
|
||||
local background = Yosin_NineBoxStretch( cacheW + 1, cacheH, "sprite/interface/lenheartwindowcommon.img", 97);
|
||||
background.SetPosition(-1, 15);
|
||||
Addchild(background);
|
||||
local twoBackground = Yosin_NineBoxStretch(4, 20, cacheW - 8, cacheH - 36, "sprite/interface/lenheartwindowcommon.img", 97);
|
||||
|
||||
//文字背景
|
||||
local twoBackground = Yosin_NineBoxStretch( cacheW - 8, cacheH - 36, "sprite/interface/lenheartwindowcommon.img", 97);
|
||||
twoBackground.SetPosition(4, 20);
|
||||
Addchild(twoBackground);
|
||||
|
||||
// 绘制标题背景
|
||||
local titleBackground = Yosin_EmeStretch(0, 0, cacheW, 20, "sprite/interface/lenheartwindowcommon.img", 609);
|
||||
titleBackground.SetScale(1, 1.2);
|
||||
AddUIChild(titleBackground);
|
||||
|
||||
// 标题背景光
|
||||
local BackgroundBright = CL_SpriteObject("sprite/interface/lenheartwindowcommon.img", 483);
|
||||
local scaleW = (cacheW / BackgroundBright.GetSize().w).tofloat();
|
||||
local BackgroundBrightSize = BackgroundBright.GetSize();
|
||||
local scaleW = (cacheW / BackgroundBrightSize.w).tofloat();
|
||||
BackgroundBright.SetScale(scaleW, 1);
|
||||
BackgroundBright.SetPosition( 0, 1);
|
||||
Addchild(BackgroundBright);
|
||||
|
||||
//确认按钮
|
||||
|
|
|
|||
|
|
@ -791,11 +791,8 @@ class _create_Character_enterName extends Yosin_Window {
|
|||
base.constructor("输入角色名称", 0, 0, 1066, 600, 0);
|
||||
|
||||
//背景
|
||||
local background = Yosin_NineBoxStretch(-2, 0, 1070, 604, "sprite/interface/lenheartwindowcommon.img", 97);
|
||||
Addchild(background);
|
||||
|
||||
//背景
|
||||
local background = Yosin_NineBoxStretch(413, 228, 240, 140, "sprite/interface/lenheartwindowcommon.img", 97);
|
||||
local background = Yosin_NineBoxStretch( 240, 140, "sprite/interface/lenheartwindowcommon.img", 97);
|
||||
background.SetPosition(413, 228);
|
||||
Addchild(background);
|
||||
|
||||
// 标题文字
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
*/
|
||||
|
||||
// local infoWindow = Sq_CreateWindow(_PersonalInfo, "个人信息窗口", 250, 60, 286, 530, 20);
|
||||
// todo 图和尺寸比例都需要修改
|
||||
// todo Yosin_Window 和 Yosin_CommonUi 会有性能开销需要检查
|
||||
class _PersonalInfo extends Yosin_Window {
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
文件用途: 背包窗口
|
||||
*/
|
||||
|
||||
//local Window = Sq_CreateWindow(_Inventory, "背包窗口", 150, 12, 262, 555, 20);
|
||||
// local Window = Sq_CreateWindow(_Inventory, "背包窗口", 150, 12, 256, 548, 20);
|
||||
class _Inventory extends Yosin_Window {
|
||||
|
||||
equipmentPage = null;
|
||||
|
|
@ -41,17 +41,24 @@ class _Inventory extends Yosin_Window {
|
|||
AddUIChild(topBtn);
|
||||
|
||||
//标题按钮
|
||||
local titlesBtn = Yosin_RowMoreTitleBtn(5, 22, 252, ["物品栏", "装扮", "宠物", "护石"], "sprite/interface/lenheartwindowcommon.img", 160);
|
||||
local titlesBtn = Yosin_RowMoreTitleBtn(5, 22, 250, ["物品栏", "装扮", "宠物", "护石"], "sprite/interface/lenheartwindowcommon.img", 160);
|
||||
AddUIChild(titlesBtn);
|
||||
|
||||
titlesBtn.LBDownOnClick = function(btns, index) {
|
||||
print(index);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
//物品栏 装备页
|
||||
equipmentPage = Inventory_EquipmentPage(2, titlesBtn.bottom() + 4, 300, Height - titlesBtn.bottom() - 4);
|
||||
equipmentPage = Inventory_EquipmentPage(2, titlesBtn.bottom(), 300, 441);
|
||||
AddUIChild(equipmentPage);
|
||||
|
||||
// 钱包
|
||||
local moneyItem = MoneyItem(7, Height - 55);
|
||||
AddUIChild(moneyItem);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -62,3 +69,86 @@ class _Inventory extends Yosin_Window {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// 金币相关数值
|
||||
class MoneyItem extends Yosin_CommonUi {
|
||||
|
||||
constructor(x, y) {
|
||||
local w = 248;
|
||||
local h = 49;
|
||||
base.constructor(x, y, w, h);
|
||||
|
||||
local txtColor = sq_RGBA(130, 105, 61, 255);
|
||||
|
||||
local bg = CL_SpriteObject("sprite/interface/newstyle/windows/inventory/inventory.img", 27);
|
||||
Addchild(bg);
|
||||
|
||||
// 复活币个数
|
||||
local ReviveNum = FontAssetManager.GenerateNormal("23434个", true, {
|
||||
color = txtColor
|
||||
});
|
||||
ReviveNum.SetPosition(120 - ReviveNum.GetSize().w, 2);
|
||||
Addchild(ReviveNum);
|
||||
|
||||
|
||||
// 胜利的证明
|
||||
local winNum = FontAssetManager.GenerateNormal("23434个", true, {
|
||||
color = txtColor
|
||||
});
|
||||
winNum.SetPosition(245 - winNum.GetSize().w, 2);
|
||||
Addchild(winNum);
|
||||
|
||||
|
||||
|
||||
// 商城
|
||||
local storeBtn = Yosin_BaseButton(1, 25, 23, 23 "sprite/interface/newstyle/windows/inventory/inventory.img", 3);
|
||||
// local storeBtn = Yosin_BaseButton(0, 0, 23, 23 "sprite/interface/newstyle/windows/inventory/inventory.img", 3);
|
||||
//点击事件回调
|
||||
// storeBtn.OnClick = function(Button) {
|
||||
// }.bindenv(this);
|
||||
AddUIChild(storeBtn);
|
||||
|
||||
|
||||
// 点券
|
||||
local storeNum = FontAssetManager.GenerateNormal("23434点券", true, {
|
||||
color = txtColor
|
||||
});
|
||||
storeNum.SetPosition(120 - storeNum.GetSize().w, 27);
|
||||
Addchild(storeNum);
|
||||
|
||||
// 金币按钮
|
||||
local moneyBtn = Yosin_BaseButton(126, storeBtn.Y, 23, 23 "sprite/interface/newstyle/windows/inventory/inventory.img", 7);
|
||||
//点击事件回调
|
||||
// moneyBtn.OnClick = function(Button) {
|
||||
// }.bindenv(this);
|
||||
AddUIChild(moneyBtn);
|
||||
|
||||
// 金币数量
|
||||
local storeNum = FontAssetManager.GenerateNormal("23434金币", true, {
|
||||
color = txtColor
|
||||
});
|
||||
storeNum.SetPosition(245 - storeNum.GetSize().w, 27);
|
||||
Addchild(storeNum);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 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();
|
||||
// }
|
||||
|
|
@ -156,7 +156,7 @@ class InventoryItem extends Yosin_CommonUi {
|
|||
base.constructor(gX, gY, gWidth, gHeight);
|
||||
|
||||
//物品分类按钮
|
||||
local itemBtns = Yosin_RowMoreTitleBtn(3, 4, 252, ["装备", "消耗品", "材料", "副职业", "任务"], "sprite/interface/lenheartwindowcommon.img", 160);
|
||||
local itemBtns = Yosin_RowMoreTitleBtn(5, 4, 248, ["装备", "消耗品", "材料", "副职业", "任务"], "sprite/interface/lenheartwindowcommon.img", 160);
|
||||
AddUIChild(itemBtns);
|
||||
|
||||
itemBtns.LBDownOnClick = function(btns, index) {
|
||||
|
|
@ -164,11 +164,12 @@ class InventoryItem extends Yosin_CommonUi {
|
|||
};
|
||||
|
||||
// 物品栏边框
|
||||
local itemBg = Yosin_NineBoxStretch(2, itemBtns.bottom(), 253, 245, "sprite/interface/lenheartwindowcommon.img", 97);
|
||||
local itemBg = Yosin_NineBoxStretch(253, 245, "sprite/interface/lenheartwindowcommon.img", 97);
|
||||
itemBg.SetPosition(2, itemBtns.bottom());
|
||||
Addchild(itemBg);
|
||||
|
||||
// 物品栏
|
||||
ItemCollection = _ItemCollection(itemBg.X + 7, itemBg.Y + 7, 7);
|
||||
ItemCollection = _ItemCollection(itemBg.X + 7, 31, 7);
|
||||
AddUIChild(ItemCollection);
|
||||
|
||||
|
||||
|
|
@ -197,15 +198,6 @@ class InventoryItem extends Yosin_CommonUi {
|
|||
local saerchBtn = Yosin_BaseButton(setBtn.X - 24, permutationBtn.Y, 23, 23 "sprite/interface/newstyle/windows/inventory/inventory.img", 94);
|
||||
AddUIChild(saerchBtn);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 复活币
|
||||
local moneyItem = MoneyItem(5, itemBgBottom + 3, 3);
|
||||
AddUIChild(moneyItem);
|
||||
|
||||
}
|
||||
|
||||
function SetItemList(gItemList) {
|
||||
|
|
@ -214,74 +206,6 @@ class InventoryItem extends Yosin_CommonUi {
|
|||
|
||||
}
|
||||
|
||||
// 金币相关数值
|
||||
class MoneyItem extends Yosin_CommonUi {
|
||||
|
||||
constructor(x, y, idx) {
|
||||
local w = 248;
|
||||
local h = 49;
|
||||
base.constructor(x, y, w, h);
|
||||
|
||||
local txtColor = sq_RGBA(130, 105, 61, 255);
|
||||
|
||||
local bg = CL_SpriteObject("sprite/interface/newstyle/windows/inventory/inventory.img", 27);
|
||||
Addchild(bg);
|
||||
|
||||
// 复活币个数
|
||||
local ReviveNum = FontAssetManager.GenerateNormal("23434个", true, {
|
||||
color = txtColor
|
||||
});
|
||||
ReviveNum.SetPosition(120 - ReviveNum.GetSize().w, 2);
|
||||
Addchild(ReviveNum);
|
||||
|
||||
|
||||
// 胜利的证明
|
||||
local winNum = FontAssetManager.GenerateNormal("23434个", true, {
|
||||
color = txtColor
|
||||
});
|
||||
winNum.SetPosition(245 - winNum.GetSize().w, 2);
|
||||
Addchild(winNum);
|
||||
|
||||
|
||||
|
||||
// 商城
|
||||
local storeBtn = Yosin_BaseButton(1, 25, 23, 23 "sprite/interface/newstyle/windows/inventory/inventory.img", 3);
|
||||
// local storeBtn = Yosin_BaseButton(0, 0, 23, 23 "sprite/interface/newstyle/windows/inventory/inventory.img", 3);
|
||||
//点击事件回调
|
||||
// storeBtn.OnClick = function(Button) {
|
||||
// }.bindenv(this);
|
||||
AddUIChild(storeBtn);
|
||||
|
||||
|
||||
// 点券
|
||||
local storeNum = FontAssetManager.GenerateNormal("23434点券", true, {
|
||||
color = txtColor
|
||||
});
|
||||
storeNum.SetPosition(120 - storeNum.GetSize().w, 27);
|
||||
Addchild(storeNum);
|
||||
|
||||
// 金币按钮
|
||||
local moneyBtn = Yosin_BaseButton(126, storeBtn.Y, 23, 23 "sprite/interface/newstyle/windows/inventory/inventory.img", 7);
|
||||
//点击事件回调
|
||||
// moneyBtn.OnClick = function(Button) {
|
||||
// }.bindenv(this);
|
||||
AddUIChild(moneyBtn);
|
||||
|
||||
// 金币数量
|
||||
local storeNum = FontAssetManager.GenerateNormal("23434金币", true, {
|
||||
color = txtColor
|
||||
});
|
||||
storeNum.SetPosition(245 - storeNum.GetSize().w, 27);
|
||||
Addchild(storeNum);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -262,14 +262,14 @@ class _ItemCollection extends Yosin_CommonUi {
|
|||
}
|
||||
|
||||
|
||||
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();
|
||||
}
|
||||
// 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