iDevGames Forums
How do I apply a perspective transform to a UIView and add to cocos2d - Printable Version

+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Game Programming Fundamentals (/forum-7.html)
+--- Thread: How do I apply a perspective transform to a UIView and add to cocos2d (/thread-10319.html)



How do I apply a perspective transform to a UIView and add to cocos2d - sefiroths - Sep 24, 2012 05:45 AM

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;