代码拉取完成,页面将自动刷新
{
"打印整个节点下的所有子节点名": {
"prefix": "printAllChildren",
"body": [
"printAllChildren($0)",
],
"description": "打印整个节点下的所有子节点名",
"scope": "lua"
},
"打印table类型转JSON日志": {
"prefix": "printJson",
"body": [
"printJson($1, $0);",
],
"description": "打印table类型转JSON日志",
"scope": "lua"
},
"打印table类型日志": {
"prefix": "PrintT",
"body": [
"PrintT($0, true);",
],
"description": "打印table类型日志",
"scope": "lua"
},
"打印常规日志": {
"prefix": "print-lua",
"body": [
"print('$1', $0);",
],
"description": "打印常规日志",
"scope": "lua"
},
"添加点击事件": {
"prefix": "AddClick",
"body": [
"AddClick($1, function()",
"\t$0",
"end)"
],
"description": "添加点击事件",
"scope": "lua"
},
"通过id获取文字多语言": {
"prefix": "GetStringById",
"body": [
"GetStringById($0)",
],
"description": "通过id获取文字多语言",
"scope": "lua"
},
"通过id获取标题多语言": {
"prefix": "GetTipsById",
"body": [
"GetTipsById($0)",
],
"description": "通过id获取标题多语言",
"scope": "lua"
},
"获取配置表": {
"prefix": "GetConf",
"body": [
"local conf = GetConf($0)",
],
"description": "获取配置表",
"scope": "lua"
},
"检测功能是否开启": {
"prefix": "CheckFuncOpen",
"body": [
"local bOpen, falseStr = CheckFuncOpen($0)",
],
"description": "检测功能是否开启",
"scope": "lua"
},
"打开界面": {
"prefix": "WndMgr:open",
"body": [
"WndMgr:open(WND_ID.$1, {$0})",
],
"description": "检测功能是否开启",
"scope": "lua"
},
"添加红点检测": {
"prefix": "RedPointMgr:relate",
"body": [
"RedPointMgr:relate('$2', $1, RedPointMgr.CheckType.$0)",
],
"description": "添加红点检测",
"scope": "lua"
},
"监听事件": {
"prefix": "EventMgr:registEvent",
"body": [
"EventMgr:registEvent(EventMgr.$0, self)",
],
"description": "监听事件",
"scope": "lua"
},
"注销事件": {
"prefix": "EventMgr:unregistEvent",
"body": [
"EventMgr:unregistEvent(EventMgr.$0, self)",
],
"description": "注销事件",
"scope": "lua"
},
"发送事件": {
"prefix": "EventMgr:send",
"body": [
"EventMgr:sendEvent(EventMgr.$1, $0)",
],
"description": "发送事件",
"scope": "lua"
},
"数组添加元素": {
"prefix": "table.insert",
"body": [
"table.insert($1, $0)",
],
"description": "数组添加元素",
"scope": "lua"
},
// ========================= coco2dx API =======================
"设置节点坐标": {
"prefix": "setPosition",
"body": [
"$1:setPosition($0)"
],
"description": "设置节点坐标",
"scope": "lua"
},
"设置X坐标": {
"prefix": "setPositionX",
"body": [
"$1:setPositionX($0)"
],
"description": "设置X坐标",
"scope": "lua"
},
"设置Y坐标": {
"prefix": "setPositionY",
"body": [
"$1:setPositionY($0)"
],
"description": "设置Y坐标",
"scope": "lua"
},
"获取节点坐标": {
"prefix": "getPosition",
"body": [
"local px, py = $0:getPosition()"
],
"description": "获取节点坐标",
"scope": "lua"
},
"设置节点角度": {
"prefix": "setRotation",
"body": [
"$1:setRotation($0)"
],
"description": "设置节点角度",
"scope": "lua"
},
"获取节点角度": {
"prefix": "getRotation",
"body": [
"local ag = $0:getRotation()"
],
"description": "获取节点角度",
"scope": "lua"
},
"设置节点缩放": {
"prefix": "setScale",
"body": [
"$1:setScale($0)"
],
"description": "设置节点缩放",
"scope": "lua"
},
"获取节点缩放": {
"prefix": "getScale",
"body": [
"local sx, sy = $0:getScale()"
],
"description": "获取节点缩放",
"scope": "lua"
},
"设置节点锚点": {
"prefix": "setAnchorPoint",
"body": [
"$1:setAnchorPoint($0)"
],
"description": "设置节点锚点",
"scope": "lua"
},
"获取节点锚点": {
"prefix": "getAnchorPoint",
"body": [
"local apx, apy = $0:getAnchorPoint()"
],
"description": "获取节点锚点",
"scope": "lua"
},
"设置节点大小": {
"prefix": "setContentSize",
"body": [
"$1:setContentSize(cc.size($0))"
],
"description": "设置节点大小",
"scope": "lua"
},
"获取节点大小": {
"prefix": "getContentSize",
"body": [
"local width, height = $0:getContentSize()"
],
"description": "获取节点大小",
"scope": "lua"
},
"设置节点状态": {
"prefix": "setVisible",
"body": [
"$1:setVisible($0)"
],
"description": "设置节点状态",
"scope": "lua"
},
"获取节点状态": {
"prefix": "getVisible",
"body": [
"$0:getVisible()"
],
"description": "获取节点状态",
"scope": "lua"
},
"获取子节点": {
"prefix": "getChildByName",
"body": [
"$1:getChildByName('$0')"
],
"description": "获取子节点",
"scope": "lua"
},
"深度获取子节点": {
"prefix": "getChildByPath",
"body": [
"$1:getChildByPath('$0')"
],
"description": "深度获取子节点",
"scope": "lua"
},
"设置ImageView类型的图片资源": {
"prefix": "loadTexture",
"body": [
"$1:loadTexture($0)"
],
"description": "设置ImageView类型的图片资源",
"scope": "lua"
},
"设置Text类型文字": {
"prefix": "setString",
"body": [
"$1:setString($0)"
],
"description": "设置Text类型文字",
"scope": "lua"
},
"获取所有的子节点": {
"prefix": "getChildren",
"body": [
"local children = $0:getChildren()"
],
"description": "获取所有的子节点",
"scope": "lua"
},
"设置节点名": {
"prefix": "setName",
"body": [
"$1:setName($0)"
],
"description": "设置节点名",
"scope": "lua"
},
"获取节点名": {
"prefix": "getName",
"body": [
"local name = $0:getName()"
],
"description": "获取节点名",
"scope": "lua"
},
"创建ImageView节点": {
"prefix": "ccui.ImageView:create",
"body": [
"local icon = ccui.ImageView:create('$0')"
],
"description": "创建ImageView节点",
"scope": "lua"
},
"创建Text节点": {
"prefix": "ccui.Text:create",
"body": [
"local tx = ccui.Text:create('', Defs.FontUrl, $0)"
],
"description": "创建Text节点",
"scope": "lua"
},
"设置Text字体颜色": {
"prefix": "setTextColor",
"body": [
"$1:setTextColor(Defs.ColorC4B.$0)"
],
"description": "设置Text字体颜色",
"scope": "lua"
},
"设置Text字体大小": {
"prefix": "setFontSize",
"body": [
"$1:setFontSize($0)"
],
"description": "设置Text字体大小",
"scope": "lua"
},
"设置Text字体描边": {
"prefix": "enableOutline",
"body": [
"$1:enableOutline(cc.c3b($0), 2)"
],
"description": "设置Text字体描边",
"scope": "lua"
},
"设置Text字体行高": {
"prefix": "setLineHeight",
"body": [
"$0:getVirtualRenderer():setLineHeight(nameTx:getFontSize())"
],
"description": "设置Text字体行高",
"scope": "lua"
},
"设置子节点添加到父节点": {
"prefix": "addChild",
"body": [
"$1:addChild($0)"
],
"description": "设置子节点添加到父节点",
"scope": "lua"
},
"加载csd界面": {
"prefix": "addChild",
"body": [
"local item = cc.CSLoader:createNode('$0')"
],
"description": "加载csd界面",
"scope": "lua"
},
"ImageView水平翻转": {
"prefix": "setFlippedX",
"body": [
"$1:setFlippedX($0)"
],
"description": "图片水平翻转",
"scope": "lua"
},
"ImageView垂直翻转": {
"prefix": "setFlippedY",
"body": [
"$1:setFlippedY($0)"
],
"description": "图片垂直翻转",
"scope": "lua"
},
"节点水平翻转": {
"prefix": "setScaleX",
"body": [
"$1:setScaleX(-1)"
],
"description": "节点水平翻转",
"scope": "lua"
},
"节点垂直翻转": {
"prefix": "setScaleY",
"body": [
"$1:setScaleY($0)"
],
"description": "节点垂直翻转",
"scope": "lua"
},
"创建sprite精灵": {
"prefix": "ccui.Sprite:create",
"body": [
"local sprite = ccui.Sprite:create('$0')"
],
"description": "创建sprite精灵",
"scope": "lua"
},
"加载sprite精灵资源": {
"prefix": "sprite:setTexture",
"body": [
"$1:setTexture('$0')"
],
"description": "加载sprite精灵资源",
"scope": "lua"
},
"创建button按钮": {
"prefix": "ccui.Sprite:create",
"body": [
"local drawBtn = ccui.Button:create('$0')"
],
"description": "创建button按钮",
"scope": "lua"
},
"创建button按钮事件": {
"prefix": "button:addClickEventListener",
"body": [
"$1:addClickEventListener(function()",
"\t$0",
"end)"
],
"description": "创建button按钮事件",
"scope": "lua"
},
"button按钮状态(禁用)": {
"prefix": "button:setEnabled",
"body": [
"$1:setEnabled($0)",
],
"description": "button按钮状态(禁用)",
"scope": "lua"
},
"button按钮置灰": {
"prefix": "button:setBright",
"body": [
"$1:setBright($0)",
],
"description": "button按钮置灰",
"scope": "lua"
},
"世界坐标转节点坐标": {
"prefix": "convertToNodeSpace",
"body": [
"$1:convertToNodeSpace($0)",
],
"description": "世界坐标转节点坐标",
"scope": "lua"
},
"节点坐标转世界坐标": {
"prefix": "convertToWorldSpace",
"body": [
"$1:convertToWorldSpace($0)",
],
"description": "节点坐标转世界坐标",
"scope": "lua"
},
"设置节点透明度": {
"prefix": "setOpacity",
"body": [
"$1:setOpacity($0)"
],
"description": "节点透明度",
"scope": "lua"
},
"获取节点透明度": {
"prefix": "getOpacity",
"body": [
"local opacity = $0:getOpacity()"
],
"description": "获取节点透明度",
"scope": "lua"
},
"设置节点是否可以点击": {
"prefix": "setTouchEnabled",
"body": [
"$1:setTouchEnabled($0)"
],
"description": "设置节点是否可以点击",
"scope": "lua"
},
"暂停该节点的全部动作": {
"prefix": "stopAllActions",
"body": [
"$0:stopAllActions()"
],
"description": "暂停该节点的全部动作",
"scope": "lua"
},
"获取父节点": {
"prefix": "getParent",
"body": [
"$0:getParent()"
],
"description": "获取父节点",
"scope": "lua"
},
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。