cocos2d / cocos2d-x

Cocos2d-x is a suite of open-source, cross-platform, game-development tools utilized by millions of developers across the globe. Its core has evolved to serve as the foundation for Cocos Creator 1.x & 2.x.
https://www.cocos.com/en/cocos2d-x
18.24k stars 7.06k forks source link

Weird offset while visiting a sprite in a RenderTexture #10453

Open KrissMu opened 9 years ago

KrissMu commented 9 years ago

Hi,

I need to use a big RenderTexture (>= 1024 * 1024) but when I render into it with the begin()/visit()/end() logic, the sprites are slightly offset. The bigger the texture is, the bigger the offsets are. On a 8192 * 8192 texture, they are between 5 and 10 pixels.

Also, the rendering at (0,0) offsets the image on the left while the rendering at the right of the image offsets on the right. So it's like the images are moved a bit too far from the center of the render texture.

I've seen this with Cocos2d-x 3.3 on Windows 7.

KrissMu commented 9 years ago

Anyone ?

I have the issue with smaller texture (512*512) too.

walzer commented 9 years ago

Could you please post a sample project, or a link to your github repository that, we can build->run->reproduce your bug easily? To be honest, I have no enough human resources to reproduce tons of bugs in this issue system.

Thanks for your help :+1:

aababy commented 9 years ago

@KrissMu, have you resolve this problem?

aababy commented 9 years ago

this is the solution Director::getInstance()->setProjection(Director::Projection::_2D); http://www.gimoo.net/t/1506/558e2dd315b08.html