Has anyone here created a coverflow effect using cocos2d or not? Basically I am trying to figure out the best way to approach creating the coverflow natively. I'm pretty sure you can do it without using cocos2d, but I would think it would be easier done using the library.
Coverflow
(17 posts) (10 voices)-
Posted 2 years ago #
-
it's not in cocos2d, but an opensource OpenGL based coverflow implementation is at:
Posted 2 years ago # -
thanks, yeah I saw that. The problem with their implementation is you're locked in to how it was built. To make changes you have to code using OpenGLES directly -- the very problem that cocos2d solves. Making any changes to their code would be a mess. If it were in cocos2d, you could much more easily change the behavior of the coverflow..
Posted 2 years ago # -
Well the closest I've seen in Cocos is the Looping Menu code from this thread:
http://www.cocos2d-iphone.org/forum/topic/139
It's used in Joao Caxaria's Banzai - Ninja Sport.... There's a lite version you can check it out in, but it's kind of a cover flow...
Posted 2 years ago # -
In his book "iPhone SDK Application Development", Jonathan Zdziarski has a whole Chapter on cover flow. With code examples. Maybe you can get the code from his website. Haven't checked it though.
Hope this helps.
Posted 2 years ago # -
Hi, just came across this new UIKit based implementation... OpenFlow:
http://apparentlogic.com/openflowMore info here:
http://fajkowski.com/blog/2009/08/02/openflow-a-coverflow-api-replacement-for-the-iphone/--yarri
Posted 2 years ago # -
I remember reading a blog about "things that will get you rejected from the app store" and there was something about an app that was rejected for using a "custom coverflow implementation." Sorry - I wish I could find the source.
I was wondering if anyone knows if Apple has relaxed that restriction over time and/or if there are any other apps in the store that use something so similar to Apple's Cover Flow?
I may have just misread the blog, but it might be something to look into if you haven't already. I'll update if I find the link.
Posted 2 years ago # -
I believe that was http://apparentlogic.com/openflow app rejected. It should be ok to use it now.
Posted 2 years ago # -
Ah, I was just about to edit my post and I see someone already found a link. A quick google found a few apps that used custom CoverFlow code and were at first rejected for using "undocumented APIs" even though they wrote their own. Seems like Apple figured out that not everyone using CoverFlow is using their APIs. I'm sure it's fine to use a CoverFlow-like experience as long as you stay away from Apple's code.
Posted 2 years ago # -
Has anyone converted the FlowCover code to a Cocos node?
Are there any alternatives that are Cocos nodes?
Would be cool to be able to set the size and location, and change the sizes of the items in the node, spacing, angles of items, etc.
Posted 2 years ago # -
why does it need to be done in cocos2d? you know you CAN use uikit, and core animation was built for this kind of stuff.
Posted 2 years ago # -
I want to have a Cocos scene that contains various nodes, and one of the nodes contains a scrollable coverflow-type view (not full screen).
If there is someway to stick a UIView into a Cocos node, please let me know.
Posted 2 years ago # -
I am also currently trying to add a cover flow in one of my apps.
I found this really nice implementation from Bill Woody. After 5 minutes work it was integrated in my project. But currently I have the problem that the background of the coverflow is magenta. Did Anyone tried to add this implementation in his cocos2d project? And if so, did you made any modifications to the opengl code from this implementation?Here is what I have done:
-(id)init { if((self = [super init])) { // get screen dimension CGSize winSize = [[CCDirector sharedDirector] winSize]; // load and add background CCSprite* bgSprite = [CCSprite spriteWithFile:@"MainMenu_Background.png"]; bgSprite.anchorPoint = ccp(0,0); bgSprite.position = ccp(0,0); [self addChild:bgSprite]; // player hint string CCLabelTTF* hintLabel = [CCLabelTTF labelWithString:NSLocalizedString(@"SID_IMAGE_SELECTION_HINT", nil) fontName:FONT_NAME fontSize:FONT_SIZE_TITLE]; hintLabel.position = ccp(winSize.width/2, winSize.height-FONT_SIZE_TITLE); hintLabel.color = ccc3(0x00, 0x00, 0x00); [self addChild:hintLabel]; // add flow cover view Coverflow = [[FlowCoverView alloc] initWithFrame:CGRectMake(0, winSize.height/3, winSize.width, winSize.height/2)]; [Coverflow setDelegate:self]; [[[CCDirector sharedDirector] openGLView] addSubview:Coverflow]; } return self; }Test delegates:
-(int)flowCoverNumberImages:(FlowCoverView *)view { return 8; } -(UIImage *)flowCover:(FlowCoverView *)view cover:(int)cover { switch(cover % 8) { case 0: default: return [UIImage imageNamed:@"test1.jpg"]; case 1: return [UIImage imageNamed:@"test2.jpg"]; case 2: return [UIImage imageNamed:@"test3.jpg"]; case 3: return [UIImage imageNamed:@"test4.jpg"]; case 4: return [UIImage imageNamed:@"test5.jpg"]; case 5: return [UIImage imageNamed:@"test6.jpg"]; case 6: return [UIImage imageNamed:@"test7.jpg"]; case 7: return [UIImage imageNamed:@"test8.jpg"]; case 8: return [UIImage imageNamed:@"test9.jpg"]; } } -(void)flowCover:(FlowCoverView *)view didSelect:(int)cover { NSLog(@"Selected Index %d", cover); }Cleanup:
-(void)dealloc { [Coverflow removeFromSuperview]; [Coverflow release]; [super dealloc]; }Posted 8 months ago # -
Seems like the opengl states changed so cocos2d is not anymore happy with them :).
When I enable FPS counter:
[director setDisplayFPS:YES];The app is crashing, in drawNumberOfQuads, in following line of code:
glDrawElements(GL_TRIANGLES, (GLsizei) n*6, GL_UNSIGNED_SHORT, (GLvoid*) (start*6*sizeof(indices_[0])) );Posted 8 months ago # -
I got it running, i just restored the previous drawing context each time it was used in the FlowCoverView and it worked. It looks awesome :)
Posted 8 months ago # -
The FlowCoverView creates an own render context, but it does not restore the render context correctly. So I added in all code parts, were the render context is used following:
EAGLContext* current = [EAGLContext currentContext]; [EAGLContext setCurrentContext:context]; ... render code ... EAGLContext setCurrentContext:current];Hope that helps, otherwise send me your email address via pm and I will send you my implementation.
Thats how it looks likes:
Posted 7 months ago #
Reply
You must log in to post.