Artifacts in the background image while moving a layer.

Artifacts in the background image while moving a layer.
0.0 0


Artifacts when moving the root layer :frowning:

Hello everybody! I have a problem with an image. It has holes in a shape of triangles. It looks like artifacts. I`m using cocos2d-x (version 2) for rendering in my iOS project, I have inserted a cocos2d-x view in my cocoa touch interface. It works pretty normal but the artifacts occurred. I`m pretty upset because i don`t have such bugs in my iPhone simulator. The structure is the following i have a scene which has a root layer, on root layer i have added a background sprite, it`s quite big (1665 х 536) and over the background i have a layer with other game objects which i`m moving. I`m implemented my platformer camera throw moving this root layer to the left and to the right. When it`s moving to the left everything is fine but when camera riches the right corner the artifacts occurred. I have to port a flash version of the game to the iOS (the original version is a flash game). The thing is the following the game has 1665х536 size and I need to squeeze it into iPhone resolution. It has portrait and landscape mode . In landscape mode it runs in full screen but in portrait mode it occupies only a part of the screen. I`m using designResolution, it has a size of 1665х536, i`m not using contentScalefactor, i set the size of the frame to the size of the UIView which contains the EAGLView.

__glView = [EAGLView sharedEGLView];
float newWidth = self.playerView.frame.size.width;
float newHeight = self.playerView.frame.size.height;
[__glView setAutoresizingMask:
UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight |
UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleTopMargin |
UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin
[self.playerView addSubview:__glView];
CCDirector* director = CCDirector::sharedDirector();
if (!g_is_loaded) {
g_root = CCScene::create();
_glView.frame = CGRectMake;
>getOpenGLView()>setFrameSize; //scaleFactor is 2 on retina display.
>getOpenGLView()->setDesignResolutionSize(CCONST~~>ARENA_WIDTH_PX , CCONST~~>ARENA_HEIGHT_PX, kResolutionNoBorder); // 1665x536

Please help me, I`m in despair

Bug.png (23.0 KB)