1:如何快速的寻找uuid对应的资源?
2绘制顺序
/** !#en zIndex is the 'key' used to sort the node relative to its siblings.<br/>
The value of zIndex should be in the range between cc.macro.MIN_ZINDEX and cc.macro.MAX_ZINDEX.<br/>
The Node's parent will sort all its children based on the zIndex value and the arrival order.<br/>
Nodes with greater zIndex will be sorted after nodes with smaller zIndex.<br/>
If two nodes have the same zIndex, then the node that was added first to the children's array will be in front of the other node in the array.<br/>
Node's order in children list will affect its rendering order. Parent is always rendering before all children.
!#zh zIndex 是用来对节点进行排序的关键属性,它决定一个节点在兄弟节点之间的位置。<br/>
zIndex 的取值应该介于 cc.macro.MIN_ZINDEX 和 cc.macro.MAX_ZINDEX 之间
父节点主要根据节点的 zIndex 和添加次序来排序,拥有更高 zIndex 的节点将被排在后面,如果两个节点的 zIndex 一致,先添加的节点会稳定排在另一个节点之前。<br/>
节点在 children 中的顺序决定了其渲染顺序。父节点永远在所有子节点之前被渲染 */
zIndex: number;
3如何通过不进入界面来刷新修改的内容?
其实creator已经给我们写好了一个任务,那么在windows启动需要做一下小修改,如下:
最后启动的时候,记得在launch.json文件中加上一句
launch.json
....
"preLaunchTask": "compile"
tasks.json
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "compile",
"type": "shell",
"command": "./test.sh",
"windows": {
"command": "${workspaceFolder}/.vscode/test.cmd"
},
"group": "test",
"presentation": {
"reveal": "always",
"panel": "new"
}
}
]
}
test.sh or test.cmd
curl http://localhost:7456/update-db
4微信UI的坐标和creatorUI坐标之间的转换?
以微信游戏圈按钮为例
假设你想将这个按钮放在游戏界面某个createUINode节点的周围
微信坐标系是从上往下,creator坐标系是从下往上
微信坐标系和creator坐标系之间打交道的是物理像素坐标系
所以我们应该传入的是物理坐标系的坐标和物理相关尺寸
creatorUI它的像素说的css像素,不等于物理像素,物理像素是实实在在一个小格子
通过cc.view.getDevicePixelRatio()这个函数我们可以获取到css像素和物理像素的比值,通俗的说,就是我一个css像素需要使用几个物理像素小格子来填充显示
此处还应该注意到,我们的坐标系的缩放问题
let rect = createUINode.getBoundingBoxToWorld();
let ratio = cc.view.getDevicePixelRatio();
let scale = cc.view.getScaleX();
let factor = scale / ratio;//算出转换因子
let button = wx.createGameClubButton({
icon: 'green',
style: {
left: rect.x * factor,
top: sysInfo.windowHeight - (rect.y + rect.height) * factor,
width: 40,
height: 40
}
})
5:空文件夹会生成.meta文件,但是空文件夹有没有办法提交到git上,但.meta文件在未跟踪选项中可以被发现,我们删了.meta文件,又会造成这个文件重新生成,因为git无法跟踪空文件夹,所以要想彻底删除这个,就必须删除空文件夹,这样再删除对应的.meta文件,就可以彻底删除了啊