【问题标题】:How can we add scrolling text in cocos2d by using UITextView?cocos2d中如何使用UITextView添加滚动文本?
【发布时间】:2010-05-05 07:44:14
【问题描述】:

我想要 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];   

我需要文本以横向模式显示,但我以以下方式获取文本。

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

如何使文本以横向模式显示。我在 cocos2d 工作。 CanOI 可以滚动文本吗?我应该添加什么来使文本上下滚动。

谢谢。

【问题讨论】:

    标签: cocoa-touch iphone-sdk-3.0 uitextview cocos2d-iphone


    【解决方案1】:

    从下面的网址我找到了答案

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

    我用过

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-06-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多