0

对任何精灵/图层/场景使用任何效果总是会在 CCActionScript.cpp 中导致此断言:

void GridAction::cacheTargetAsGridNode()
{
    _gridNodeTarget = dynamic_cast<NodeGrid*> (_target);
    CCASSERT(_gridNodeTarget, "GridActions can only used on NodeGrid");
}

因此,此代码将不起作用,因为 Sprite 或任何其他原语都是从 Node 继承的(而不是从 NodeGrid 继承的)。换句话说,示例应用程序也不起作用:

CCSprite* sp = CCSprite::create("title.jpg");  
sp->setPosition(ccp(240, 160));  
addChild(sp);  
CCActionInterval* pageTurn3D = CCPageTurn3D::create(4, CCSize(20, 20));  
sp->runAction(pageTurn3D); 

这是一个 alpha 限制,还是我做错了什么?

4

1 回答 1

1

这是 alpha 版本的限制:

*    - Limitations
[...]
 *        - GridBase actions are not supported (eg: Lens, Ripple, Twirl)
[...]
于 2014-03-26T02:36:29.707 回答