140 lines
5.1 KiB
Lua
140 lines
5.1 KiB
Lua
local ui = {}
|
|
local _V = function(...) return SL:GetMetaValue(...) end
|
|
local FUNCQUEUE = {}
|
|
local TAGOBJ = {}
|
|
|
|
function ui.init(parent, __data__, __update__)
|
|
if __update__ then return ui.update(__data__) end
|
|
-- Create Layer
|
|
local Layer = GUI:Node_Create(parent, "Layer", 0, 0)
|
|
GUI:setTag(Layer, -1)
|
|
|
|
-- Create bg_close
|
|
local bg_close = GUI:Layout_Create(Layer, "bg_close", 0, 0, 1136, 640, false)
|
|
GUI:Layout_setBackGroundColorType(bg_close, 1)
|
|
GUI:Layout_setBackGroundColor(bg_close, "#000000")
|
|
GUI:Layout_setBackGroundColorOpacity(bg_close, 0)
|
|
GUI:setAnchorPoint(bg_close, 0.00, 0.00)
|
|
GUI:setTouchEnabled(bg_close, true)
|
|
GUI:setTag(bg_close, -1)
|
|
|
|
-- Create nd_root
|
|
local nd_root = GUI:Node_Create(Layer, "nd_root", 568, 320)
|
|
GUI:setTag(nd_root, 670)
|
|
TAGOBJ["670"] = nd_root
|
|
|
|
-- Create img_bg
|
|
local img_bg = GUI:Image_Create(nd_root, "img_bg", 0, 0, "res/custom/20/0.png")
|
|
GUI:setChineseName(img_bg, "背景图片")
|
|
GUI:setAnchorPoint(img_bg, 0.50, 0.50)
|
|
GUI:setTouchEnabled(img_bg, true)
|
|
GUI:setTag(img_bg, -1)
|
|
|
|
-- Create btn_close
|
|
local btn_close = GUI:Button_Create(img_bg, "btn_close", 759, 429, "res/public/1900000510.png")
|
|
GUI:Button_loadTexturePressed(btn_close, "res/public/1900000511.png")
|
|
GUI:setContentSize(btn_close, 26, 42)
|
|
GUI:setIgnoreContentAdaptWithSize(btn_close, false)
|
|
GUI:Button_setTitleText(btn_close, [[]])
|
|
GUI:Button_setTitleColor(btn_close, "#ffffff")
|
|
GUI:Button_setTitleFontSize(btn_close, 14)
|
|
GUI:Button_titleDisableOutLine(btn_close)
|
|
GUI:setAnchorPoint(btn_close, 0.00, 0.00)
|
|
GUI:setTouchEnabled(btn_close, true)
|
|
GUI:setTag(btn_close, -1)
|
|
|
|
-- Create up_btn
|
|
local up_btn = GUI:Button_Create(img_bg, "up_btn", 516, 62, "res/custom/20/6.png")
|
|
GUI:Button_loadTexturePressed(up_btn, "res/custom/20/10.png")
|
|
GUI:setContentSize(up_btn, 174, 48)
|
|
GUI:setIgnoreContentAdaptWithSize(up_btn, false)
|
|
GUI:Button_setTitleText(up_btn, [[]])
|
|
GUI:Button_setTitleColor(up_btn, "#ffffff")
|
|
GUI:Button_setTitleFontSize(up_btn, 14)
|
|
GUI:Button_titleEnableOutline(up_btn, "#000000", 1)
|
|
GUI:setAnchorPoint(up_btn, 0.00, 0.00)
|
|
GUI:setTouchEnabled(up_btn, true)
|
|
GUI:setTag(up_btn, -1)
|
|
|
|
-- Create name_Text
|
|
local name_Text = GUI:Text_Create(img_bg, "name_Text", 180, 453, 16, "#c0c0c0", [[文本]])
|
|
GUI:Text_enableOutline(name_Text, "#000000", 2)
|
|
GUI:setAnchorPoint(name_Text, 0.50, 0.50)
|
|
GUI:setTouchEnabled(name_Text, false)
|
|
GUI:setTag(name_Text, 0)
|
|
|
|
-- Create mini_map_img
|
|
local mini_map_img = GUI:Image_Create(img_bg, "mini_map_img", 600, 286, "scene/uiminimap/100001.png")
|
|
GUI:setContentSize(mini_map_img, 280, 214)
|
|
GUI:setIgnoreContentAdaptWithSize(mini_map_img, false)
|
|
GUI:setAnchorPoint(mini_map_img, 0.50, 0.50)
|
|
GUI:setTouchEnabled(mini_map_img, false)
|
|
GUI:setTag(mini_map_img, 0)
|
|
|
|
-- Create mini_map_ze
|
|
local mini_map_ze = GUI:Image_Create(img_bg, "mini_map_ze", 600, 286, "res/custom/20/1.png")
|
|
GUI:setAnchorPoint(mini_map_ze, 0.50, 0.50)
|
|
GUI:setTouchEnabled(mini_map_ze, false)
|
|
GUI:setTag(mini_map_ze, 0)
|
|
|
|
-- Create BOSS_Layout
|
|
local BOSS_Layout = GUI:Layout_Create(img_bg, "BOSS_Layout", 52, 182, 403, 251, false)
|
|
GUI:setAnchorPoint(BOSS_Layout, 0.00, 0.00)
|
|
GUI:setTouchEnabled(BOSS_Layout, false)
|
|
GUI:setTag(BOSS_Layout, 0)
|
|
|
|
-- Create up_boss
|
|
local up_boss = GUI:Button_Create(BOSS_Layout, "up_boss", 0, 141, "res/custom/20/11.png")
|
|
GUI:Button_loadTexturePressed(up_boss, "res/custom/20/12.png")
|
|
GUI:setContentSize(up_boss, 38, 80)
|
|
GUI:setIgnoreContentAdaptWithSize(up_boss, false)
|
|
GUI:Button_setTitleText(up_boss, [[]])
|
|
GUI:Button_setTitleColor(up_boss, "#ffffff")
|
|
GUI:Button_setTitleFontSize(up_boss, 16)
|
|
GUI:Button_titleEnableOutline(up_boss, "#000000", 1)
|
|
GUI:setAnchorPoint(up_boss, 0.00, 0.50)
|
|
GUI:setTouchEnabled(up_boss, true)
|
|
GUI:setTag(up_boss, 0)
|
|
|
|
-- Create down_boss
|
|
local down_boss = GUI:Button_Create(BOSS_Layout, "down_boss", 363, 141, "res/custom/20/13.png")
|
|
GUI:Button_loadTexturePressed(down_boss, "res/custom/20/14.png")
|
|
GUI:setContentSize(down_boss, 38, 80)
|
|
GUI:setIgnoreContentAdaptWithSize(down_boss, false)
|
|
GUI:Button_setTitleText(down_boss, [[]])
|
|
GUI:Button_setTitleColor(down_boss, "#ffffff")
|
|
GUI:Button_setTitleFontSize(down_boss, 16)
|
|
GUI:Button_titleEnableOutline(down_boss, "#000000", 1)
|
|
GUI:setAnchorPoint(down_boss, 0.00, 0.50)
|
|
GUI:setTouchEnabled(down_boss, true)
|
|
GUI:setTag(down_boss, 0)
|
|
|
|
-- Create boss_effect_Layout
|
|
local boss_effect_Layout = GUI:Layout_Create(BOSS_Layout, "boss_effect_Layout", 188, 40, 112, 200, false)
|
|
GUI:setAnchorPoint(boss_effect_Layout, 0.00, 0.00)
|
|
GUI:setTouchEnabled(boss_effect_Layout, false)
|
|
GUI:setTag(boss_effect_Layout, 0)
|
|
|
|
-- Create Text_Layout
|
|
local Text_Layout = GUI:Layout_Create(img_bg, "Text_Layout", 53, 36, 402, 102, false)
|
|
GUI:setAnchorPoint(Text_Layout, 0.00, 0.00)
|
|
GUI:setTouchEnabled(Text_Layout, false)
|
|
GUI:setTag(Text_Layout, 0)
|
|
|
|
-- Create Text_ListView
|
|
local Text_ListView = GUI:ListView_Create(Text_Layout, "Text_ListView", 225, 51, 268, 98, 1)
|
|
GUI:setAnchorPoint(Text_ListView, 0.50, 0.50)
|
|
GUI:setTouchEnabled(Text_ListView, true)
|
|
GUI:setTag(Text_ListView, 0)
|
|
|
|
ui.update(__data__)
|
|
return Layer
|
|
end
|
|
|
|
function ui.update(data)
|
|
for _, func in pairs(FUNCQUEUE) do
|
|
if func then func(data) end
|
|
end
|
|
end
|
|
|
|
return ui
|