本文整理汇总了C++中Box2D::Height方法的典型用法代码示例。如果您正苦于以下问题:C++ Box2D::Height方法的具体用法?C++ Box2D::Height怎么用?C++ Box2D::Height使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Box2D
的用法示例。
在下文中一共展示了Box2D::Height方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RenderLabel
void LocationView::RenderLabel()
{
if(!GetLabelBindToChart() && m_label->IsVisible() && !App::Inst().GetMouseDragging())
{
// get screen coordinates for location
Point3D winPos = App::Inst().GetMapController()->ProjectToScreen(GetPosition());
Box2D bb = m_label->GetBoundingBox();
float size = m_size * App::Inst().GetResolutionFactor();
// compensate for perspective projection
float angle = sin(App::Inst().GetViewport()->GetCamera()->GetPitch()*DEG_TO_RAD);
float perspectiveSize = size * angle;
float perspectiveTextHeight = bb.Height()*angle;
// calculate screen position of label
uint offset = 2 * App::Inst().GetResolutionFactor();
if(m_label->GetLabelPosition() == _T("Right"))
m_label->SetScreenPosition(Point3D(winPos.x+size+offset, winPos.y-bb.Height()/3, LABEL_LAYER));
else if(m_label->GetLabelPosition() == _T("Left"))
m_label->SetScreenPosition(Point3D(winPos.x-bb.Width()-size-offset, winPos.y-bb.Height()/3, LABEL_LAYER));
else if(m_label->GetLabelPosition() == _T("Top"))
m_label->SetScreenPosition(Point3D(winPos.x-bb.Width()/2, winPos.y+perspectiveSize+offset, LABEL_LAYER));
else if(m_label->GetLabelPosition() == _T("Bottom"))
m_label->SetScreenPosition(Point3D(winPos.x-bb.Width()/2, winPos.y-perspectiveTextHeight-perspectiveSize, LABEL_LAYER));
m_label->Render();
}
}