SL:Print("跳过来了5")
-- 客户端注册 接收消息
local function networkCB(msgID, p1, p2, p3, msgData)
-- SL:Print("客户端的协议--"..msgID, p1, p2, p3, msgData)
if msgID == 100 then
parent = GUI:Win_Create("Win_1", 0, 0, 600, 800) --创建一个父节点(parent)
GUI:LoadExport(parent, "cq_best") --将模块里的代码内容挂载到父节点下面.参数1:父节点 参数2:模块文件名
local ui = GUI:ui_delegate(parent) -- 获取父节点下所有的快捷子控件组
GUI:Win_SetDrag(parent, ui.ImageView)
GUI:addOnClickEvent(ui.Button1,btn_cs)
-- local aa = GUI:Layout_Create(parent, "223000", 300, 200, 500, 200, true)
-- GUI:Layout_setBackGroundColor(aa, {"#44DDFF","#FB0000"})
-- GUI:Layout_setBackGroundColorType(aa, 2)
-------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------
end
end
------------------------------"测试"按钮函数------------------------------------------------------------------
function btn_cs()
SL:Print("点击了测试按钮")
end
------------------------------父节点关闭按钮函数------------------------------------------------------------------
function win_close()
if parent then -- 如果父节点"parent"存在,那么执行关闭该父节点
SL:Print("执行关闭父节点")
GUI:Win_Close(parent) --关闭父节点"parent"
end
end
local function keyf2() --F2 快捷键函数
chongzhi.main()
end
local function keyf3() --F3 快捷键函数
end
------------------------------OK框回调函数------------------------------------------------------------------
-- GUI:ItemBox_Create(parent, "OK_1", 600, 280, "res/ly/ik3.png", 1, "*")
------------------------------特效(Effect)回调函数------------------------------------------------------------------
-- aa = GUI:Effect_Create(parent, "eff_1", 600 , 200, 0, 142, 0, 0, 4, 100)
-- GUI:Effect_play(aa, 0, 0, false, 100, true)
-- GUI:Effect_stop(aa, 3, 0, 0)
-- GUI:Effect_addOnCompleteEvent(aa, effcom)
------------------------------ GUiOK框函数练习-------------------------------------------------------------------------------
-- GUI:ItemBox_Create(parent, "OK_1", 600, 280, "res/ly/ik3.png", 1, "*")
-- GUI:addOnClickEvent(ui.Button1,btn_cs)
------------------------------ GUI装备展示框函数练习-------------------------------------------------------------------------------
-- local equipData = SL:GetMetaValue("EQUIP_DATA", 0) --SL库函数,获取元变量赋值到equipdata中
-- if equipData then -- 变量存在则执行
-- local info = {} --设置一个表
-- info.index = equipData.Index --定义表
-- info.itemData = equipData -- 传入装备数据
-- info.look = true
-- info.bgVisible = true
-- info.starLv = true
-- aa = GUI:ItemShow_Create(parent, "item", 600, 280, info) --按照定义好的INFO表来设置一个装备展示框
-- end
-- GUI:ItemShow_addReplaceClickEvent(aa, click) --设置一个装备展示框点击事件 点击回调函数click
-- GUI:ItemShow_addDoubleEvent(aa, doubleClick) --设置一个装备展示框双击事件 点击回调函数doubleClick
-- GUI:ItemShow_addPressEvent(aa, longPress) --设置一个装备展示框长按事件 长按回调函数longPress
-- GUI:ItemShow_setIconGrey(aa, true) --灰化
-- GUI:ItemShow_setItemShowChooseState(aa, false) --设置选中状态
-- GUI:ItemShow_setMoveEable(aa, false) --设置是否可以拖拽
------------------------------ GUI物品框函数练习-------------------------------------------------------------------------------
-- local itb = {}
-- itb.index = 10064 -- 物品Index
-- itb.look = true -- 是否显示tips
-- itb.bgVisible = false -- 是否显示背景框
-- itb.count = 1 -- 物品数量
-- itb.color = 225 -- 颜色ID (0~255)
-- GUI:ItemShow_Create(parent, "item", 600 , 280, itb)
------------------------------ GUI文本函数练习-------------------------------------------------------------------------------
-- local str = "初秋鹏鹏去打球吃肉串"
-- local text_name = GUI:Text_Create(parent,"cqtext", 600, 280, 16, "#ffff00", str)
-- GUI:Text_setTextColor(text_name, "#EFD6AD")
-- GUI:Text_setFontSize(text_name, 23)
-- GUI:Text_setFontName(text_name,"fonts/4.ttf")
-- GUI:Text_enableOutline(text_name,"#100808",2)
------------------------------ GUI图片函数练习-------------------------------------------------------------------------------
-- local imgPath = "res/ly/logo2.png" --设置图片路径
-- qimg = GUI:Image_Create(parent, "cqimg", 525, 343, imgPath) --创建图片对象
-- GUI:Image_loadTexture(qimg, imgPath) --加载图片
-- GUI:Timeline_FadeTo(qimg, 100, 2, timelineCB)
-- GUI:Timeline_FadeIn(qimg, 2, timelineCB)
-- GUI:Timeline_FadeOut(qimg, 2, timelineCB) --两秒淡出
-- local ui = GUI:ui_delegate(parent) -- 获取父节点下所有的快捷子控件组
-- GUI:Timeline_Window5(qimg, timelineCB) -- 996特效封装函数
-- GUI:Timeline_FadeTo(qimg, 120, 3, timelineCB) --设置透明度
-- GUI:Timeline_FadeIn(qimg, 3, timelineCB) --淡入"没明白"****
-- GUI:Button_setTitleText(qimg,'初秋') --更改按钮文字内容
-- GUI:Button_setTitleColor(qimg, "#FFFF00") -- 更改文字颜色
-- GUI:Button_titleEnableOutline(qimg, "#080000", 2) --更改文字描边颜色以及颜色
-- GUI:Button_setGrey(qimg, true) --设置按钮灰化
-- for k, v in pairs(ui) do
-- SL:print(k,v)
-- end
-- if ui.Button2 then --ui为table
-- SL:Print("存在")
-- else
-- SL:Print("***不存在")
-- end
GUI:addKeyboardEvent({"KEY_F2"},keyf2) --创建一个F2快捷键事件
GUI:addKeyboardEvent({"KEY_F3"},keyf3) --创建一个F3快捷键事件