コード例 #1
0
ProgressTimer* TransitionProgressRadialCW::progressTimerNodeWithRenderTexture(RenderTexture* texture)
{
    Size size = Director::getInstance()->getWinSize();
    
    ProgressTimer* node = ProgressTimer::create(texture->getSprite());
    
    // but it is flipped upside down so we flip the sprite
    node->getSprite()->setFlippedY(true);
    node->setType( ProgressTimer::Type::RADIAL );
    
    //    Return the radial type that we want to use
    node->setReverseDirection(true);
    node->setPercentage(100);
    node->setPosition(Vector2(size.width/2, size.height/2));
    node->setAnchorPoint(Vector2(0.5f,0.5f));
    
    return node;
}