60 lines
No EOL
2.1 KiB
Lua
60 lines
No EOL
2.1 KiB
Lua
local ui = {}
|
|
function ui.init(parent)
|
|
-- Create Layer
|
|
local Layer = GUI:Node_Create(parent, "Layer", 0.00, 0.00)
|
|
GUI:setAnchorPoint(Layer, 0.50, 0.50)
|
|
GUI:setTag(Layer, -1)
|
|
|
|
-- Create bg_close
|
|
local bg_close = GUI:Layout_Create(Layer, "bg_close", 0.00, 0.00, 1136.00, 640.00, false)
|
|
GUI:Layout_setBackGroundColorType(bg_close, 1)
|
|
GUI:Layout_setBackGroundColor(bg_close, "#000000")
|
|
GUI:Layout_setBackGroundColorOpacity(bg_close, 0)
|
|
GUI:setTouchEnabled(bg_close, true)
|
|
GUI:setTag(bg_close, -1)
|
|
|
|
-- Create nd_root
|
|
local nd_root = GUI:Node_Create(Layer, "nd_root", 568.00, 320.00)
|
|
GUI:setAnchorPoint(nd_root, 0.50, 0.50)
|
|
GUI:setTag(nd_root, 670)
|
|
|
|
-- Create img_bg
|
|
local img_bg = GUI:Image_Create(nd_root, "img_bg", 0.00, 0.00, "res/custom/14/2.png")
|
|
GUI:setChineseName(img_bg, "背景图片")
|
|
GUI:setAnchorPoint(img_bg, 0.50, 0.50)
|
|
GUI:setTouchEnabled(img_bg, true)
|
|
GUI:setTag(img_bg, -1)
|
|
|
|
-- Create human
|
|
local human = GUI:Image_Create(img_bg, "human", 31.00, 0.00, "res/private/gui_edit/ImageFile.png")
|
|
GUI:setContentSize(human, 0, 0)
|
|
GUI:setIgnoreContentAdaptWithSize(human, false)
|
|
GUI:setTouchEnabled(human, false)
|
|
GUI:setTag(human, -1)
|
|
|
|
-- Create btn_close
|
|
local btn_close = GUI:Button_Create(img_bg, "btn_close", 659.00, 307.00, "res/custom/Label/x1.png")
|
|
GUI:Button_setTitleText(btn_close, "")
|
|
GUI:Button_setTitleColor(btn_close, "#ffffff")
|
|
GUI:Button_setTitleFontSize(btn_close, 14)
|
|
GUI:Button_titleDisableOutLine(btn_close)
|
|
GUI:setTouchEnabled(btn_close, true)
|
|
GUI:setTag(btn_close, -1)
|
|
|
|
-- Create Button
|
|
local Button = GUI:Button_Create(img_bg, "Button", 348.00, 47.00, "res/custom/14/0.png")
|
|
GUI:Button_loadTexturePressed(Button, "res/custom/14/1.png")
|
|
GUI:Button_setTitleText(Button, "")
|
|
GUI:Button_setTitleColor(Button, "#ffffff")
|
|
GUI:Button_setTitleFontSize(Button, 14)
|
|
GUI:Button_titleEnableOutline(Button, "#000000", 1)
|
|
GUI:setTouchEnabled(Button, true)
|
|
GUI:setTag(Button, -1)
|
|
|
|
-- Create y_open
|
|
local y_open = GUI:Image_Create(img_bg, "y_open", 403.00, 15.00, "res/custom/Label/1.png")
|
|
GUI:setTouchEnabled(y_open, false)
|
|
GUI:setTag(y_open, -1)
|
|
GUI:setVisible(y_open, false)
|
|
end
|
|
return ui |