I will use sub camera like this,
cocos2d::Camera* pCamera1 = cocos2d:
:create();
pCamera1->setCameraFlag( CameraFlag::USER1 );
this->addChild( pCamera1 );
and some Label add to something Node as child node.
So Label is not updated because its updated at Node::visit() in Scene::render(),
actually not updated in Node::visit() by defaultCamera.
Therefore Label transform is not correct.
In my case I modified below,
uint32_t Node::processParentFlags(const Mat4& parentTransform, uint32_t parentFlags)
{
// add code
bool visibleByCamera = isVisitableByVisitingCamera();
if(_usingNormalizedPosition) {
CCASSERT(_parent, "setNormalizedPosition() doesn't work with orphan nodes");
if ((parentFlags & FLAGS_CONTENT_SIZE_DIRTY) || _normalizedPositionDirty) {
auto s = _parent->getContentSize();
_position.x = _normalizedPosition.x * s.width;
_position.y = _normalizedPosition.y * s.height;
// add code
if( visibleByCamera == true )
{
_transformUpdated = _transformDirty = _inverseDirty = true;
_normalizedPositionDirty = false;
}
}
}
uint32_t flags = parentFlags;
flags |= (_transformUpdated ? FLAGS_TRANSFORM_DIRTY : 0);
flags |= (_contentSizeDirty ? FLAGS_CONTENT_SIZE_DIRTY : 0);
if(flags & FLAGS_DIRTY_MASK)
_modelViewTransform = this->transform(parentTransform);
// add code
if( visibleByCamera == true )
{
_transformUpdated = false;
_contentSizeDirty = false;
}
return flags;
}
I was troubled by one day to this issue 