iDevGames Forums

Full Version: How do I apply a perspective transform to a UIView and add to cocos2d
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i have made this code to add a webview to cocos2d layer, the webview is added but the webview is not "rotated on y", but scaled on x... the text is perfectly orizontal...as if there is no perspective matrix, but isometric... what error i'm doing?

Code:
UIWebView *creditsScroll=[[UIWebView alloc] init];
[creditsScroll setUserInteractionEnabled:YES];
[creditsScroll setBackgroundColor:[UIColor cyanColor]];//[UIColor clearColor]];
creditsScroll.opaque=YES;
creditsScroll.frame=CGRectMake(0, 0, 300, 600);
[[[CCDirector sharedDirector] openGLView] addSubview:creditsScroll];  
[creditsScroll loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"iCD_credits_it" ofType:@"html"] isDirectory:NO]]];

CATransform3D _3Dt = CATransform3DRotate(creditsScroll.layer.transform,1.14, 0.0, 1.0,0.0);
creditsScroll.layer.transform=_3Dt;
Reference URL's