本文整理汇总了C++中CGroupMap::addCtrl方法的典型用法代码示例。如果您正苦于以下问题:C++ CGroupMap::addCtrl方法的具体用法?C++ CGroupMap::addCtrl怎么用?C++ CGroupMap::addCtrl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGroupMap
的用法示例。
在下文中一共展示了CGroupMap::addCtrl方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setWorldMapNumEdges
//*********************************************************
void CDisplayerVisualActivitySequence::setWorldMapNumEdges(uint count)
{
//H_AUTO(R2_CDisplayerVisualActivitySequence_setWorldMapNumEdges)
// TODO nico : try to factor with CPrimRender::setWorldMapNumEdges
nlassert(_AddedToWorldMap);
CGroupMap *gm = CTool::getWorldMap();
nlassert(gm);
if (count < _WorldMapEdges.size())
{
for(uint k = count; k < _WorldMapEdges.size(); ++k)
{
gm->delCtrl(_WorldMapEdges[k]);
}
}
else
{
uint left = count - (uint)_WorldMapEdges.size();
while (left --)
{
CCtrlQuad *cq = new CCtrlQuad;
cq->setModulateGlobalColor(false);
cq->setActive(true);
gm->addCtrl(cq);
cq->setParent(gm);
cq->setRenderLayer(1);
_WorldMapEdges.push_back(cq);
}
}
_WorldMapEdges.resize(count);
for(uint k = 0; k < count; ++k)
{
_WorldMapEdges[k]->setTexture(CV_FootStepMapTexture.get());
}
}
示例2: onAdd
//*********************************************************************************************************
void CInstanceMapDeco::onAdd(CGroupMap &owner)
{
//H_AUTO(R2_CInstanceMapDeco_onAdd)
nlassert(_Instance);
nlassert(!_Main);
nlassert(!_Over);
nlassert(!_OverInvalid);
_Main = new CCtrlButtonEntity(*_Instance);
_Main->setPosRef(Hotspot_MM);
_Main->setParentPosRef(Hotspot_BL);
_Main->setModulateGlobalColorAll(false);
owner.addCtrl(_Main);
_Main->setParent(&owner);
_Main->setRenderLayer(2);
_Main->setId(owner.getId() + ":" + _Instance->getId());
_Main->setActive(_Active);
//
_Over = newQuad(owner);
_Over->setRenderLayer(3);
_Over->setActive(_Active);
//
_OverInvalid = newQuad(owner);
_OverInvalid->setRenderLayer(4);
_OverInvalid->setActive(_Active && _InvalidPos);
//
if (_Orientable)
{
_Orient = newQuad(owner);
_Orient->setTexture(CV_MapEntityOrientTexture.get());
_Orient->setRenderLayer(3);
_Orient->setActive(_Active);
}
//
CInterfaceGroup *window = owner.getParentContainer();
if (window)
{
for(uint k = 0; k < 2; ++k)
{
_GlowStar[k] = new CCtrlQuad;
_GlowStar[k]->setActive(false);
_GlowStar[k]->setModulateGlobalColor(false);
window->addCtrl(_GlowStar[k]);
_GlowStar[k]->setParent(window);
_GlowStar[k]->setAdditif(true);
_GlowStar[k]->setTexture(CV_MapGlowStarTexture.get());
}
}
_AddedToMap = true;
}
示例3: onAdd
// *********************************************************
void CPrimRender::onAdd(CGroupMap &owner)
{
//H_AUTO(R2_CPrimRender_onAdd)
nlassert(!_AddedToWorldMap);
_AddedToWorldMap = true;
_WorldMapPoly = newCtrlPolygon(); // TODO: create only if needed
_WorldMapPoly->setParent(&owner);
owner.addCtrl(_WorldMapPoly);
_WorldMapPoly->setActive(false);
_WorldMapPoly->setId(owner.getId() + ":" + _WorldMapPoly->getId());
for(uint k = 0; k < _WorldMapEdges.size(); ++k)
{
_WorldMapEdges[k]->setId(_WorldMapPoly->getId() + toString("_e%d", (int) k ));
}
}
示例4: setWorldMapNumEdges
// *********************************************************
void CPrimRender::setWorldMapNumEdges(uint count)
{
//H_AUTO(R2_CPrimRender_setWorldMapNumEdges)
nlassert(_AddedToWorldMap);
CGroupMap *gm = CTool::getWorldMap();
nlassert(gm);
if (count < _WorldMapEdges.size())
{
for(uint k = count; k < _WorldMapEdges.size(); ++k)
{
gm->delCtrl(_WorldMapEdges[k]);
}
}
else
{
uint left = count - (uint)_WorldMapEdges.size();
while (left --)
{
CCtrlQuad *cq = newCtrlQuad((uint)_WorldMapEdges.size());
cq->setModulateGlobalColor(false);
cq->setActive(_Active);
gm->addCtrl(cq);
cq->setParent(gm);
cq->setRenderLayer(1);
_WorldMapEdges.push_back(cq);
if (_WorldMapPoly)
{
cq->setId(_WorldMapPoly->getId() + toString("_e%d", _WorldMapEdges.size() - 1));
}
}
}
_WorldMapEdges.resize(count);
for(uint k = 0; k < count; ++k)
{
_WorldMapEdges[k]->setTexture(_Look.EdgeLook.WorldMapTexture);
_WorldMapEdges[k]->setColorRGBA(_Look.EdgeLook.WorldMapColor);
}
}