本文整理汇总了C++中CGroupMap::windowToScreen方法的典型用法代码示例。如果您正苦于以下问题:C++ CGroupMap::windowToScreen方法的具体用法?C++ CGroupMap::windowToScreen怎么用?C++ CGroupMap::windowToScreen使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGroupMap
的用法示例。
在下文中一共展示了CGroupMap::windowToScreen方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onUpdate
//.........这里部分代码省略.........
{
inter.set(wmax.x, m.y);
}
}
else if (dir.x < 0.f)
{
d0 = (wmin.x - m.x) / dir.x;
if (dir.y > 0.f)
{
d1 = (wmax.y - m.y) / dir.y;
inter = m + std::min(d0, d1) * dir;
}
else if (dir.y < 0.f)
{
d1 = (wmin.y - m.y) / dir.y;
inter = m + std::min(d0, d1) * dir;
}
else
{
inter.set(wmin.x, m.y);
}
}
else
{
if (dir.y > 0.f)
{
inter.set(m.x, wmax.y);
}
else if (dir.y < 0.f)
{
inter.set(m.x, wmin.y);
}
else
{
inter = m;
}
}
float size = CV_MapEntityFarArrowSize.get();
// TMP TMP
size = size;
float bias = 1.f;
dir.normalize();
CVector2f winInter;
groupMap.worldToWindow(winInter, inter);
_Over->setRenderLayer(3);
_Over->setQuad(winInter - (size + bias) * dir, winInter - bias * dir, 0.5f * size);
//
if (_GlowStar[0])
{
sint32 screenInterX, screenInterY;
groupMap.windowToScreen(screenInterX, screenInterY, (sint32) winInter.x, (sint32) winInter.y);
sint32 refCornerX, refCornerY;
_GlowStar[0]->getParent()->getCorner(refCornerX, refCornerY, Hotspot_BL);
_GlowStarPos.set((float) (screenInterX - refCornerX), (float) (screenInterY - refCornerY), 0.f);
_GlowStarActive = true;
}
}
else
{
// VISIBLE CASE
_GlowStar[0]->setActive(false);
_GlowStar[1]->setActive(false);
if (closeView || hasFocus)
{
_Over->setActive(true);
if (!closeView)
{
_Over->setColorRGBA(CV_MapEntitySelectColor.get());
}
else
{
_Over->setColorRGBA(selected ? CV_MapEntitySelectColor.get() : CV_MapEntityHighlightColor.get());
}
const std::string &tex = closeView ? CV_MapEntitySelectTexture.get() : CV_MapEntitySmallHighlightTexture.get();
_Over->setTexture(tex);
_Over->setRenderLayer(2);
_Over->setQuad(tex, CVector((float) x, (float) y, 0.f));
}
else
{
_Over->setActive(false);
}
}
}
else
{
// no focus
_Over->setActive(false);
_GlowStar[0]->setActive(false);
_GlowStar[1]->setActive(false);
}
// update 'quad that signal invalid pos'
if (_OverInvalid->getActive())
{
const std::string &tex = closeView ? CV_MapEntityInvalidTexture.get() : CV_MapEntityInvalidTextureSmall.get();
_OverInvalid->setTexture(tex);
_OverInvalid->setQuad(tex, CVector((float) x, (float) y, 0.f));
}
}