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 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:v2.2.1-release Nov 22, 2019
1 check passed
let c = children[i];
let cName = c._name;
let isUseless = imgExp.test(cName);
isUseless = isUseless || txtExp.test(cName);
Copy link
Member

@jareguo jareguo Nov 22, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

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

@jareguo jareguo Nov 22, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants