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

fix tiledmap object texture render error #5633

Conversation

@sunnylanwanjun
Copy link
Contributor

sunnylanwanjun commented Oct 28, 2019

修复object group纹理坐标不正确的问题。
修复在同一帧插入删除再插入用户节点,会报组件已存在的问题。(因为组件在下一帧才会从node中移除,这里调用了内部的_removeComponent方法,把组件立即从node中移除,然后再手动调用组件destroy方法。)

@@ -224,7 +224,8 @@ let TiledObjectGroup = cc.Class({
sp = imgNode.addComponent(cc.Sprite);
}
sp.spriteFrame = new cc.SpriteFrame();
sp.spriteFrame.setTexture(grid.tileset.sourceImage, grid);
let rect = cc.rect(grid.x, grid.y, grid.width, grid.height);
sp.spriteFrame.setTexture(grid.tileset.sourceImage, rect);

This comment has been minimized.

Copy link
@jareguo

jareguo Oct 28, 2019

Contributor

直接 cc.rect(grid) 就行

@jareguo jareguo merged commit e186ad9 into cocos-creator:v2.2.1-release Oct 29, 2019
1 check passed
1 check passed
ci/circleci: test Your tests passed on CircleCI!
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.