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


Copy link

@sunnylanwanjun sunnylanwanjun commented Oct 28, 2019

修复object group纹理坐标不正确的问题。

@@ -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);
Copy link

@jareguo jareguo Oct 28, 2019

Choose a reason for hiding this comment

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

直接 cc.rect(grid) 就行

cocos2d/tilemap/CCTiledLayer.js Outdated Show resolved Hide resolved
@jareguo jareguo merged commit e186ad9 into cocos:v2.2.1-release Oct 29, 2019
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

3 participants