How to integrate UIImagepickerview in cocos2d - cocos2d-iphone

Can anybody please help me out with my question any help will be appericiated.
Question-
How do i integrate UIImagePickerView in cocos2d ?
I have gone through many links and had also googled too much but cant find myself any better help so please help me out.

I'm not quite sure but i think you can do it the same way you normally create a UIImagePickerView and then add it to the screen using:
[[[CCDirector sharedDirector] openGLView] addSubview:ImagePickerView];
Here is the link to another question on SO:
How we can show UIViewController and UIView by using Cocos2d?

Related

cocos2d replaceScene with CCTransitionSlideInL has no effect

Recently,I have to implement paging functions with cocos2d using transition of CCTransitionSlideInL.But there is no effect.I tried some effects,and surprised to find that only transitions of CCTransitionSplitCols and CCTransitionSplitRows effect,others not.Followed is my code.
[[CCDirector sharedDirector] replaceScene:[CCTransitionSlideInL transitionWithDuration:1.2f scene:scene]];
I would be very grateful if someone can help me solve this problem.
What does "does not work" mean in your case?
The code you have written works perfectly. If "does not work" means nothing happens then the issue is likely in how your layer is created. I suspect the layer variable is invalid. If you want help on that, post your layer creation code.
So,finally I solved it myself.That is because the transition of CCTransitionSlideInL must collide with the method of draw that CCLayer supports.More specifically,it collides with CCRenderTexture I used in the method.

Scrolling region in cocos2d version 2

I am trying to implement a help screen in my cocos2d game, using cocos2d version 2.0. My screen will have a title bar ("Help") at the top and then the rest of the screen below that is where I want to put a scrolling help section. Ideally I would be able to put both text and images into this help window.
The problem is that cocos2d does not have any functionality like UIScrollView, and from what I have seen doing Google searches, every custom solution I have found seems to have problems with various bugs popping up on various devices.
I have tried these solutions thus far:
CCScrollLayer: http://www.cocos2d-iphone.org/forum/topic/17118/page/3
Scrolling CCNode: http://tonyngo.net/2011/11/scrolling-ccnode-in-cocos2d/
CCScrollView: http://bitbattalion.com/2011/09/uikit-uiscrollview-and-cocos2d/
The closest thing I got to work was embedding a UITextView but that seemed to randomly crash after a few scrolls so it seems unreliable to me.
Does anyone know of a good simple robust solution to this problem? It seems like it should be straightforward but it isn't.
I recommend that you make new class say:(HelpViewClass) and implement it with an UIScrollView and add whatever you want to add on UIScrollView and then you can use this as a child to your layer.
Steps
Make a class - inherited with UIView
Add UIScrollView to the View.
Add Your components to it.
Add this UIView to the HelpLayer.
You can add any UIKit component to the cocos2d Layer by using this
[[[CCDirector sharedDirector] view] addSubView:scrollView];
Note : Remove all UI component when you go back from this HelpLayer.
I think this may help you !

Steps to add a cocos2d scene to a UIView

Can anyone say the steps to add cocos2d scene to a uikit project. I am new to cocos2d and not aware how to add the files related to cocos2d and also please explain where to add the eagl view in the ui files.
And also share a link for adding a cocos2d in a uiview and not the other way round.
Thanks
For my mind, it is not a good idea to mix uikit with cocos2d. Examples of creating eaglview you can find in any of cocos2d templates. Here you can read how to install cocos2d templates.
http://www.cocos2d-iphone.org/wiki/doku.php/prog_guide:lesson_1._install_test

Coloring application using Cocos2D

I trying to make an empty CCSprite then I want to hand drawing on it using touch controls.
But, I don't have an idea how make it and don't know it's possible.
So, PLS help me or give me some advice.
Thanks
I wrote a demo program for CCRenderTexture which shows you how to draw sprites (or whatever you want) with touches:
Hi You can use CCRenderTexture example from Cocos2d for drawing..
Check out this link http://www.cocos2d-iphone.org/forum/topic/8474

dynamic drawing in cocos2d?

I am working on a game which would take touch gestures as inputs. Now, i would like to display the path/gesture as the user draws it. Can someone please tell me how to do this in cocos2d?
I tried to override the draw method and used ccDrawPoint(). But the point just keeps following the touch. I guess this is because the previous drawing is getting overwritten.
Can you tell me where i am going wrong here or suggest a better way to implement this?
i found a solution with CCRenderTexture sample test in cocos2d. Though i could not find enough documentation on it, but the sample code is enough for a start.