开发者

How can we add scrolling text in cocos2d by using UITextView?

I want a UITextView in cocos2d. I used in init method I wrote the code ,

 UITextView *textView = [[UITextView alloc] initWithFrame:CGRectMake(0,0, windowSize.height/2,windowSize.width/2)];
 textView.backgroundColor = [UIColor clearColor];
 textView.text = @"I am First enemy";
 [textView setEditable:NO]; 

 [[[CCDirector sharedDirector]openGLView]addSubview:textView];  

the orientation is in this way

 [[CCDirector sharedDirector] setDeviceOrientation:CCDeviceOrientationLandscapeLeft];   

I need the text to appear in landscape mode, but I am getting the text in following way.

alt text http://www.freeimagehosting.net/uploads/b0de877fb2.png

How can I make the text to appear in the landScape mode. I am working in cocos2d. CanOI scroll the tex开发者_StackOverflow中文版t ? What should i add to make the text scroll up and down.

Thank you.


from the below url I found my answer

http://www.cocos2d-iphone.org/forum/topic/3210

I used

textView.transform = CGAffineTransformMakeRotation(CC_DEGREES_TO_RADIANS( 90.0f ));
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜