2012-08-17 2 views
0

NSString을 그리려는 중이지만 어떤 이유로 렌더링되지 않습니다.NSString을 그리지 않습니까?

- (void)renderScene { 
    // Make sure we are renderin to the frame buffer 
    [EAGLContext setCurrentContext:context]; 

    glBindFramebufferOES(GL_FRAMEBUFFER_OES, viewFramebuffer); 

    // Clear the color buffer with the glClearColor which has been set  
    glClear(GL_COLOR_BUFFER_BIT); 

    //Render the game Scene 
    if(gameState == 0){ 

     //MENU 
     [menu renderAtPoint: CGPointMake(0, 0) centerOfImage: NO]; 

    } else if(gameState == 1){ 

     //GAMEPLAY 

     [bk renderAtPoint: CGPointMake(0, 0) centerOfImage: NO]; 

     [self drawScore]; 

     [player draw]; 

     [squares render]; 

     [scoreString drawAtPoint: CGPointMake(262, 250) withFont:[UIFont fontWithName:@"TimesNewRoman" size: 1.0f]]; //RIGHT HERE IS THE DRAW STRING 

    } else if(gameState ==2){ 

     //DEATH SCREEN 

     [squared renderAtPoint: CGPointMake(0, 0) centerOfImage: NO]; 

    } 

답변

0

코어 그래픽과 OpenGL을 혼합하려고합니다. 이 문제를 해결할 수있는 간단한 방법은 자식 창 (UIView 또는 UILabel)을 만든 다음 자식에서 텍스트 문자열을 설정하는 것입니다. 하위보기의 투명도도 설정할 수 있습니다.

비트 맵으로 그림을 그려서 OpenGL 텍스처로 사용하거나 OpenGL을 사용하여 비트 맵 또는 윤곽선으로 글꼴을 그리는 등 다른 방법이 있지만 작업에 따라 다릅니다. 필요에 따라 다릅니다.