background preloader


Facebook Twitter

Bug tracker.

Change sprite frame

Repeating background. Current community your communities Sign up or log in to customize your list. more stack exchange communities Stack Exchange sign up log in tour help careers 2.0 Stack Overflow Ask Question Take the 2-minute tour × Stack Overflow is a question and answer site for professional and enthusiast programmers.

repeating background

Repeating background in cocos2d has black edges! 2 Answers active oldest votes Your Answer Sign up or log in Sign up using Google Sign up using Facebook Sign up using Stack Exchange Post as a guest discard By posting your answer, you agree to the privacy policy and terms of service. Not the answer you're looking for? Community Bulletin blog Changes and guidelines for the Protected Question status Linked Infinite CCLayer Background How can you repeat a background in cocos2d when HxW lengths are not a power of 2? Related Cocos2d-iPhone 0.8 sound-engine woes cocos2d ccsprite animation How to draw a background fast in cocos2d? Muting sound problem cocos2d background with pattern texture How do I repeat sprite horizontally ?

Retina display. I am not quite sure how use HD images for sprites in cocos2d.

retina display

I looked through the documentation, and downloaded the newest beta which supports points instead of pixels, but I don't understand the whole -hd suffix idea. In other word I need help and have no idea how to use retina quality graphics in my cocos2d game. I feel that it is very simple, but I cannot find anything on doing this. Any help would be greatly appreciated. Ok so maybe this is asking too much but, it would be very helpful if someone could give me the code a tell me where to put it. Cocos2d extensions. Zoom effect. Zooming, is fairly simple, simply set the scale property of your main game layer... but there are a few catches.

Zoom effect

When you scale the layer, it will shift the position of the layer. It won't automatically zoom towards the center of what you're currently looking at. If you have any type of scrolling in your game, you'll need to account for this. Box2D Tutorial: Collision filtering. Hello, Today I want to make a tutorial about collision filtering in the Box2D engine, because it is something that is not that easy to master, and yet it is a very powerful and useful feature.

Box2D Tutorial: Collision filtering

Note: examples and source code are related to the LibGDX (Android) implementation of the Box2D API, but the concepts are the same for any other implementation, only the syntax may differ. There are two ways to deal with collision filtering: by using categories and masks, or by using groups. These parameters can be found in the Filter component of a Fixture. Filtering collisions with any of these attributes will assure you that collision checks between two bodies that should not collide with each other will not be evaluated at all, resulting in a gain of speed.

Capture OpenGL ES View as an Image. - (UIImage*)snapshot:(UIView*)eaglview // Get the size of the backing CAEAGLLayer GLint backingWidth, backingHeight; glBindRenderbufferOES(GL_RENDERBUFFER_OES, _colorRenderbuffer); glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_WIDTH_OES, &backingWidth); glGetRenderbufferParameterivOES(GL_RENDERBUFFER_OES, GL_RENDERBUFFER_HEIGHT_OES, &backingHeight); NSInteger x = 0, y = 0, width = backingWidth, height = backingHeight; NSInteger dataLength = width * height * 4; GLubyte *data = (GLubyte*)malloc(dataLength * sizeof(GLubyte)); // Read pixel data from the framebuffer glPixelStorei(GL_PACK_ALIGNMENT, 4); glReadPixels(x, y, width, height, GL_RGBA, GL_UNSIGNED_BYTE, data); // Create a CGImage with the pixel data // If your OpenGL ES content is opaque, use kCGImageAlphaNoneSkipLast to ignore the alpha channel // otherwise, use kCGImageAlphaPremultipliedLast CGDataProviderRef ref = CGDataProviderCreateWithData(NULL, data, dataLength, NULL);

Capture OpenGL ES View as an Image

How to use CCProgressTimer in Cocos2D to show progress? Cocos2d for iPhone.