100 lines
3.4 KiB
Lua
100 lines
3.4 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/41/bg.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", 758, 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 btn_ListView
|
||
local btn_ListView = GUI:ListView_Create(img_bg, "btn_ListView", 61, 32, 141, 398, 1)
|
||
GUI:setAnchorPoint(btn_ListView, 0.00, 0.00)
|
||
GUI:setTouchEnabled(btn_ListView, true)
|
||
GUI:setTag(btn_ListView, 0)
|
||
|
||
-- Create Button_1
|
||
local Button_1 = GUI:Button_Create(btn_ListView, "Button_1", 0, 350, "res/custom/41/btn/1.png")
|
||
GUI:Button_setTitleText(Button_1, [[按钮]])
|
||
GUI:Button_setTitleColor(Button_1, "#ffffff")
|
||
GUI:Button_setTitleFontSize(Button_1, 16)
|
||
GUI:Button_titleEnableOutline(Button_1, "#000000", 1)
|
||
GUI:setAnchorPoint(Button_1, 0.00, 0.00)
|
||
GUI:setTouchEnabled(Button_1, true)
|
||
GUI:setTag(Button_1, 0)
|
||
|
||
-- Create ItemShow
|
||
local ItemShow = GUI:ItemShow_Create(img_bg, "ItemShow", 470, 290, {index = 1, count = 1, look = true, bgVisible = false, color = 255})
|
||
GUI:setAnchorPoint(ItemShow, 0.50, 0.50)
|
||
GUI:setTag(ItemShow, 0)
|
||
|
||
-- Create cost_Layout
|
||
local cost_Layout = GUI:Layout_Create(img_bg, "cost_Layout", 317, 132, 304, 81, false)
|
||
GUI:setAnchorPoint(cost_Layout, 0.00, 0.00)
|
||
GUI:setTouchEnabled(cost_Layout, false)
|
||
GUI:setTag(cost_Layout, 0)
|
||
|
||
-- Create Text_success
|
||
local Text_success = GUI:Text_Create(img_bg, "Text_success", 472, 106, 16, "#00ff00", [[成功率:20%]])
|
||
GUI:Text_enableOutline(Text_success, "#000000", 1)
|
||
GUI:setAnchorPoint(Text_success, 0.50, 0.50)
|
||
GUI:setTouchEnabled(Text_success, false)
|
||
GUI:setTag(Text_success, 0)
|
||
|
||
-- Create up_btn
|
||
local up_btn = GUI:Button_Create(img_bg, "up_btn", 406, 41, "res/custom/41/2.png")
|
||
GUI:Button_setTitleText(up_btn, [[]])
|
||
GUI:Button_setTitleColor(up_btn, "#ffffff")
|
||
GUI:Button_setTitleFontSize(up_btn, 16)
|
||
GUI:Button_titleEnableOutline(up_btn, "#000000", 1)
|
||
GUI:setAnchorPoint(up_btn, 0.00, 0.00)
|
||
GUI:setTouchEnabled(up_btn, true)
|
||
GUI:setTag(up_btn, 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
|