本文整理汇总了C++中CFrame::SetWidth方法的典型用法代码示例。如果您正苦于以下问题:C++ CFrame::SetWidth方法的具体用法?C++ CFrame::SetWidth怎么用?C++ CFrame::SetWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CFrame
的用法示例。
在下文中一共展示了CFrame::SetWidth方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LoadSingleAnimation
CAnimation* CAnimationManager::LoadSingleAnimation(string szFileName, string szImageName)
{
CAnimation* Anim = new CAnimation();
TiXmlDocument doc;
// Adding Paths to filename for animations
string szPath = "resource/animations/";
szPath += szFileName;
string szImagePath = "resource/graphics/";
szImagePath += szImageName;
do
{
if( doc.LoadFile(szPath.c_str() ) == false )
break;
TiXmlElement* pRoot = doc.RootElement();
if( !pRoot )
break;
TiXmlElement* pAnim = pRoot->FirstChildElement("Animation");
if( pAnim == NULL )
break;
while( pAnim )
{
TiXmlElement* pNewAnim = pAnim;
//***************Animation IsLooping**********************//
if( pNewAnim->Attribute("IsLooping") == NULL )
break;
int dIsLooping = 0;
pNewAnim->Attribute("IsLooping", &dIsLooping);
if( dIsLooping != 0 )
Anim->SetIsLooping(true);
else
Anim->SetIsLooping(false);
Anim->SetImageID(CSGD_TextureManager::GetInstance()->LoadTexture(szImagePath.c_str() ) );
//********************Animation Name*************************//
if( pNewAnim->Attribute("Name") == NULL )
break;
const char* szName;
szName = pNewAnim->Attribute("Name");
Anim->SetName(szName);
TiXmlElement* pFrame = pNewAnim->FirstChildElement("Frames");
if( pFrame == NULL )
break;
// Animation Frames
while( pFrame )
{
CFrame* Frame = new CFrame();
TiXmlElement* pNewFrame = pFrame;
////*****************Setting Height*********************************//
if( pNewFrame->Attribute("Height") == NULL )
break;
double dHeight = 0.0;
pNewFrame->Attribute("Height",&dHeight);
Frame->SetHeight((int)dHeight);
////*******************Setting Width*******************************//
if( pNewFrame->Attribute("Width") == NULL )
break;
double dWidth = 0.0;
pNewFrame->Attribute("Width",&dWidth);
Frame->SetWidth((int)dWidth);
//*****************Setting Anchor X*********************************//
if( pNewFrame->Attribute("AnchorX") == NULL)
break;
double dAnchorX = 0.0;
pNewFrame->Attribute("AnchorX",&dAnchorX);
Frame->SetAnchorX((int)dAnchorX);
////*******************Setting Anchor Y*******************************//
if( pNewFrame->Attribute("AnchorY") == NULL )
//.........这里部分代码省略.........