使用VScode开发有一段时间了,现在记录一下自己的一些开发经验和快速开发的设置。黑喂狗~
这是我的个人配置,大家可以个性化
{
"workbench.colorTheme": "Monokai",
"luaide.scriptRoots": [
"${workspaceRoot}"
],
"explorer.confirmDelete": false,
"luaide.automaticDownloadingDebugFile": true,
"diffEditor.ignoreTrimWhitespace": false,
// 全局变量颜色
"luaide.golbalFieldColor": "#FFFF00",
// 全局方法颜色
"luaide.golbalFunColor": "#DD00FF",
"editor.minimap.enabled": true,
"workbench.statusBar.visible": false,
"workbench.activityBar.visible": true,
"window.menuBarVisibility": "default",
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/*.meta":true
},
"luaide.apiType": "cocos2dx",
// luaide 模板文件夹
"luaide.luaTemplatesDir": "${workspaceRoot}/../temp",
// luaide 宏变量申明
"luaide.macroList": [
{
"name" : "author",
"value" : "XQP"
}
],
"editor.wordWrap": "on",
"window.zoomLevel": 0,
"diffEditor.renderSideBySide": true,
}
下面是我的快速开发模板
--[[
@filename: {fileBasenameNoExtension}
@Author: {author}
@Data: {time}
@最好的代码从来不用补丁,最好的工作,从来不用加班!
]]--
local {fileBasenameNoExtension} = class("{fileBasenameNoExtension}",cc.load("mvc").UiViewBase)
--local temp = import(".temp")
{fileBasenameNoExtension}.isNeedDoLayerOut = true
{fileBasenameNoExtension}.RESOURCE_FILENAME = "{fileBasenameNoExtension}.csb"
{fileBasenameNoExtension}.RESOURCE_BINDING = {
["Image_bg"] = {["varname"] = "Image_bg"}
}
--[[
@desc 方法初始化
author: {author}
time:{time}
@_callback: 方法参数
return
]]
function {fileBasenameNoExtension}:onCreate(_callback)
local closeBtn = self.Image_bg:getChildByName("btn_close")
closeBtn:onCustomTouch(handler(self, self.touchEvent))
end
--[[
@desc touch 初始化
author: {author}
time:{time}
--@sender: closeBtn
return
]]
function {fileBasenameNoExtension}:touchEvent(sender)
if sender:getName() == "btn_close" then
self:removeFromParent()
end
end
--[[
@desc {fileBasenameNoExtension} 进入函数
author: {author}
time:{time}
return
]]
function {fileBasenameNoExtension}:onEnter()
end
--[[
@desc {fileBasenameNoExtension} 退出函数
author: {author}
time:{time}
return
]]
function {fileBasenameNoExtension}:onExit()
end
return {fileBasenameNoExtension}