本文整理汇总了C++中CFrame::SetCollisionRect方法的典型用法代码示例。如果您正苦于以下问题:C++ CFrame::SetCollisionRect方法的具体用法?C++ CFrame::SetCollisionRect怎么用?C++ CFrame::SetCollisionRect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFrame
的用法示例。
在下文中一共展示了CFrame::SetCollisionRect方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadAnimation
//.........这里部分代码省略.........
{
tempDrawRect.right = tempDrawRect.left + nTemp;
}
if(pDrawRect->QueryIntAttribute("height",&nTemp) != TIXML_NO_ATTRIBUTE)
{
tempDrawRect.bottom = tempDrawRect.top + nTemp;
}
// Set the Draw Rect
tempFrame.SetDrawRect(tempDrawRect);
// Get the collsion Rect
TiXmlElement* pCollisionRect = pDrawRect->NextSiblingElement("CollisionRect");
RectD tempCollisionRect;
if(pCollisionRect->QueryIntAttribute("x",&nTemp) != TIXML_NO_ATTRIBUTE)
{
tempCollisionRect.left = nTemp;
}
if(pCollisionRect->QueryIntAttribute("y",&nTemp) != TIXML_NO_ATTRIBUTE)
{
tempCollisionRect.top = nTemp;
}
if(pCollisionRect->QueryIntAttribute("width",&nTemp) != TIXML_NO_ATTRIBUTE)
{
tempCollisionRect.right = tempCollisionRect.left + nTemp;
tempCollisionRect.width = nTemp;
}
if(pCollisionRect->QueryIntAttribute("height",&nTemp) != TIXML_NO_ATTRIBUTE)
{
tempCollisionRect.bottom = tempCollisionRect.top + nTemp;
tempCollisionRect.height = nTemp;
}
// Set the collision Rect
tempFrame.SetCollisionRect(tempCollisionRect);
// Get the anchor
TiXmlElement* pAnchor = pDrawRect->NextSiblingElement("Anchor");
Point tempAnchor;
if(pAnchor->QueryIntAttribute("x",&nTemp) != TIXML_NO_ATTRIBUTE)
{
tempAnchor.x = nTemp;
}
if(pAnchor->QueryIntAttribute("y",&nTemp) != TIXML_NO_ATTRIBUTE)
{
tempAnchor.y = nTemp;
}
tempFrame.SetAnchorPoint(tempAnchor);
TiXmlElement* pWeapon = pAnchor->NextSiblingElement("WeaponCollisionRect");
RectD tempWeaponCollisionRect;
if(pWeapon->QueryIntAttribute("x",&nTemp) != TIXML_NO_ATTRIBUTE)
{
tempWeaponCollisionRect.left = nTemp;
}
if(pWeapon->QueryIntAttribute("y",&nTemp) != TIXML_NO_ATTRIBUTE)
{
tempWeaponCollisionRect.top = nTemp;
}
if(pWeapon->QueryIntAttribute("width",&nTemp) != TIXML_NO_ATTRIBUTE)
{
tempWeaponCollisionRect.right = tempWeaponCollisionRect.left + nTemp;
}
if(pWeapon->QueryIntAttribute("height",&nTemp) != TIXML_NO_ATTRIBUTE)
{
tempWeaponCollisionRect.bottom = tempWeaponCollisionRect.top + nTemp;