fairyGUI cocos2d-x 运行时坑点总结

  1. 多摄像机支持不完整,慎用自定义摄像机渲染fairyGUI
    cameraMask实现不完整。类似Button的容器,内部有多个GObject,但是设置cameraMask只会设置到当前渲染的GObject的displayObject,其它状态的设置不到,异常尴尬。即使修正了setCameraMask,也会GComponent::hitTest的事件分发判断也是不可修正的,fairyRoot分发事件,但是fairyRoot永远是default摄像机,不能引用引擎currentCamera,导致hitTest不能正确判断点击区域。
  2. GList的setVirtualAndLoop之后,顺序有问题,可如下修正。但是循环滚动位置错乱的问题没有定位到原因。

    void GList::removeChildrenToPool(int beginIndex, int endIndex)
    {
        if (endIndex < 0 || endIndex >= _children.size())
            endIndex = (int)_children.size() - 1;
    #if 1
        // fix item order: returnToPool() use push, and getObject() use pop, the order will broken
        for (int i = endIndex; i >= beginIndex; --i)
            removeChildToPoolAt(i);
    #else
        // backup old codes
        for (int i = beginIndex; i <= endIndex; ++i)
            removeChildToPoolAt(beginIndex);
    #endif
    }

标签: Cocos2d-x

添加新评论