--响应事件函数 local function selectedEvent ( sender , eventType ) if eventType == ccui.CheckBoxEventType.selected then cclog( eventType == ccui.CheckBoxEventType.selected ) elseif eventType == ccui.CheckBoxEventType.unselected then cclog(
--响应事件函数
local function selectedEvent(sender,eventType)
if eventType == ccui.CheckBoxEventType.selected then
cclog("eventType == ccui.CheckBoxEventType.selected ")
elseif eventType == ccui.CheckBoxEventType.unselected then
cclog("ccui.CheckBoxEventType.unselected unselected ")
end
end
--创建复选框
local checkBox = ccui.CheckBox:create()
checkBox:setTouchEnabled(true)
checkBox:loadTextures("check_box_normal.png",
"check_box_normal_press.png",
"check_box_active.png",
"check_box_normal_disable.png",
"check_box_active_disable.png")
checkBox:setPosition(cc.p(120, 300)) --坐标
checkBox:addEventListenerCheckBox(selectedEvent) --注册事件
layerFarm:addChild(checkBox,10) --添加到图层
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号