如何在cocos2d中使用UITextView添加滚动文本?
我想要一个 cocos2d 中的 UITextView。我在 init 方法中使用了我编写的代码,
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];
方向是这样的,
[[CCDirector sharedDirector] setDeviceOrientation:CCDeviceOrientationLandscapeLeft];
我需要文本以横向模式显示,但我以以下方式获取文本。
替代文本 http://www.freeimagehosting.net/uploads/b0de877fb2.png
如何我可以让文本以景观模式显示吗?我在 cocos2d 工作。可以滚动文本吗?我应该添加什么才能使文本上下滚动。
谢谢。
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 text ? What should i add to make the text scroll up and down.
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从下面的网址我找到了我的答案
http://www.cocos2d-iphone.org/ forum/topic/3210
我用过
from the below url I found my answer
http://www.cocos2d-iphone.org/forum/topic/3210
I used