Hi, I posted this on the google discussion group, but it looks like the community is over here now on this new forum, so I've also moved my question over here. (sorry dont mean to double post)
Is it possible to add sprites/cocosnodes above (z order wise) a
UIImageView? Basically trying to get a photo from photo library, add
it to layer and then put some sprites on top. But the image view is
always on top.
Note, I also tried just loading the photo into a [Sprite
spriteWithCGImage:image.CGimage], and this works well for the z-
ordering, but it seems like the photo quality drops very noticeably
with this approach - as if the color pallete was reduced, or low-
quality-jpeg-like artifacts appear. It just appears that way to me, I
have no idea what it is actually doing to reduce the quality. So if I
can change a texture parameter or something to get better quality, I
am equally open to that. Although, I've tried experimenting with
GL_NEAREST, GL_LINEAR etc with not much luck.
Here is how i tried using the UIImageView
@implementation GameNode // superclass is Layer
-(id) init {
...
CGRect frame = [[[Director sharedDirector] openGLView] frame];
imageView = [[UIImageView alloc] initWithFrame:frame];
[[[Director sharedDirector] openGLView] addSubview:imageView];
[[[Director sharedDirector] openGLView]
sendSubviewToBack:imageView];
return self;
}
-(void)imagePickerController:(UIImagePickerController *)picker
didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)
editingInfo {
[picker dismissModalViewControllerAnimated:YES];
imagePickerController.view.hidden = YES;
[imagePickerController.view removeFromSuperview];
imageView.hidden = NO;
imageView.image = image;
// make semi transparent, so i can see sprites behind the photo
imageView.alpha = .4;
}
@end
Thanks,
Chris