顶部工具条窗口
This commit is contained in:
parent
e503d20581
commit
8812074f05
|
|
@ -81,6 +81,7 @@ l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\UI\Widget\Text_Button.nut
|
||||||
l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\UI\Window\0_Login.nut
|
l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\UI\Window\0_Login.nut
|
||||||
l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\UI\Window\1_Select_Character.nut
|
l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\UI\Window\1_Select_Character.nut
|
||||||
l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\UI\Window\2_create_Character.nut
|
l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\UI\Window\2_create_Character.nut
|
||||||
|
l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\UI\Window\3_Top_tool.nut
|
||||||
l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\UI\Window\233_HUD_Message.nut
|
l:\Yosin_Engine\Yosin&Kiwano_DOF\sqr\User\UI\Window\233_HUD_Message.nut
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,108 @@
|
||||||
|
/*
|
||||||
|
文件名:3_Top_tool.nut
|
||||||
|
路径:User/UI/Window/3_Top_tool.nut
|
||||||
|
创建日期:2024-12-21 23:43
|
||||||
|
文件用途: 顶部工具条
|
||||||
|
*/
|
||||||
|
|
||||||
|
class _Top_tool extends Yosin_Window {
|
||||||
|
|
||||||
|
//是否为独立窗口
|
||||||
|
IsIndependent = false;
|
||||||
|
|
||||||
|
timeTextActor = null;
|
||||||
|
|
||||||
|
constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH) {
|
||||||
|
base.constructor(gObjectId, gX, gY, gWidth, gHeight, gTitleH);
|
||||||
|
|
||||||
|
//注册绘制
|
||||||
|
RegisterDraw();
|
||||||
|
//注册控件
|
||||||
|
RegisterWidget();
|
||||||
|
}
|
||||||
|
|
||||||
|
function RegisterWidget() {
|
||||||
|
local background = Yosin_EmeStretch(0, 0, 650, 20, "sprite/interface/lenheartwindowcommon.img", 612);
|
||||||
|
AddUIChild(background);
|
||||||
|
|
||||||
|
local timeBackGround = Yosin_EmeStretch(14, 2, 90, 14, "sprite/interface/lenheartwindowcommon.img", 615);
|
||||||
|
AddUIChild(timeBackGround);
|
||||||
|
|
||||||
|
|
||||||
|
// 时间
|
||||||
|
timeTextActor = FontAssetManager.GenerateNormal(getTimeString(), true, {
|
||||||
|
color = sq_RGBA(200, 195, 169, 255)
|
||||||
|
});
|
||||||
|
timeTextActor.SetPosition(20, 4);
|
||||||
|
Addchild(timeTextActor);
|
||||||
|
|
||||||
|
// 三角
|
||||||
|
local jiao = CL_SpriteObject("sprite/interface/lenheartwindowcommon.img", 622);
|
||||||
|
jiao.SetPosition(85, 7.5);
|
||||||
|
Addchild(jiao);
|
||||||
|
|
||||||
|
// 最小化
|
||||||
|
local minButton = _Top_tool_Button(576, 1, 22, 16 "sprite/interface/lenheartwindowcommon.img", 618);
|
||||||
|
AddUIChild(minButton);
|
||||||
|
// 最大化
|
||||||
|
local maxButton = _Top_tool_Button(598, 1, 22, 16 "sprite/interface/lenheartwindowcommon.img", 628);
|
||||||
|
AddUIChild(maxButton);
|
||||||
|
// 关闭
|
||||||
|
local closeButton = _Top_tool_Button(620, 1, 22, 16 "sprite/interface/lenheartwindowcommon.img", 624);
|
||||||
|
AddUIChild(closeButton);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function RegisterDraw() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function getTimeString() {
|
||||||
|
local date = date(time());
|
||||||
|
local timeStr = "";
|
||||||
|
if (date.hour >= 12) {
|
||||||
|
timeStr = "PM " + (date.hour - 12).tostring() + ":" + date.min.tostring();
|
||||||
|
}else{
|
||||||
|
timeStr = "AM " + date.hour.tostring() + ":" + date.min.tostring();
|
||||||
|
}
|
||||||
|
return timeStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//逻辑入口
|
||||||
|
function Proc(Dt) {
|
||||||
|
SyncPos(X, Y);
|
||||||
|
base.Proc(Dt);
|
||||||
|
|
||||||
|
if (time() % 60 == 0){
|
||||||
|
timeTextActor.SetText(getTimeString());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class _Top_tool_Button extends Yosin_BaseButton {
|
||||||
|
|
||||||
|
border = null;
|
||||||
|
|
||||||
|
constructor(X, Y, W, H, Path, Idx) {
|
||||||
|
base.constructor(X, Y, W, H, Path, Idx);
|
||||||
|
|
||||||
|
border = CL_SpriteObject("sprite/interface/lenheartwindowcommon.img", 623);
|
||||||
|
Addchild(border);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//逻辑入口
|
||||||
|
function Proc(obj) {
|
||||||
|
base.Proc(obj);
|
||||||
|
border.SetVisible(isLBDown);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -235,5 +235,8 @@
|
||||||
},
|
},
|
||||||
"User/Object/Map/MapCamera.nut": {
|
"User/Object/Map/MapCamera.nut": {
|
||||||
"description": "摄像机类"
|
"description": "摄像机类"
|
||||||
|
},
|
||||||
|
"User/UI/Window/3_Top_tool.nut": {
|
||||||
|
"description": "顶部工具条"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue