Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tiledmap object group optimize #5728

Conversation

@sunnylanwanjun
Copy link
Contributor

sunnylanwanjun commented Nov 13, 2019

EN:
Supports tileset including multi-map formats
Fixed the problem of incorrect image position of 45 ° Angle object group
cc.Node is used to achieve object group image, which is convenient for users to achieve occlusion effect

CN:
支持tileset包含多贴图格式
修复45度角object group图片位置不正确的问题
使用cc.Node 实现 object group图片,方便用户用它实现遮挡效果

@holycanvas holycanvas requested a review from 2youyou2 Nov 19, 2019
@holycanvas holycanvas merged commit 019179c into cocos-creator:v2.2.1-release Nov 22, 2019
1 check passed
1 check passed
ci/circleci: test Your tests passed on CircleCI!
Details
let c = children[i];
let cName = c._name;
let isUseless = imgExp.test(cName);
isUseless = isUseless || txtExp.test(cName);

This comment has been minimized.

Copy link
@jareguo

jareguo Nov 22, 2019

Contributor

直接 let isUseless = imgExp.test(cName) || txtExp.test(cName); 就行了吧

// destroy useless node
let children = this.node.children;
let imgExp = /^img\d+$/;
let txtExp = /^text\d+$/;

This comment has been minimized.

Copy link
@jareguo

jareguo Nov 22, 2019

Contributor

感觉可以合并成一个正则性能应该更好点 /^(?:img|text)\d+$/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.