本文整理汇总了C++中Sprite::Height方法的典型用法代码示例。如果您正苦于以下问题:C++ Sprite::Height方法的具体用法?C++ Sprite::Height怎么用?C++ Sprite::Height使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sprite
的用法示例。
在下文中一共展示了Sprite::Height方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Initialize
bool ParallaxComponentLayer::Initialize()
{
RETURN_FALSE_IF_FALSE(BaseCaseLayer::Initialize());
mMainSprite = NodeFactory::Instance().CreateQuadSprite("test2.png");
mMainSprite->DockToScreen(DockPoint::MiddleTop);
mMainSprite->SetAnchorPoint(AnchorPoint::MiddleTop);
AddChild(mMainSprite);
mComponent = ComponentFactory::Instance().Create<ParallaxComponent>();
mMainSprite->AddComponent(mComponent);
FOR_EACH_SIZE(i, mChildCount)
{
Sprite* child = NodeFactory::Instance().CreateQuadSprite("test2.png");
child->SetAnchorPoint(AnchorPoint::MiddleTop);
child->SetPosition(mMainSprite->Position());
child->MoveY(-child->Height()*(i+1));
AddChild(child);
Point3F ratio = Point3F::One;
ratio.X = (float)(i + 1) / mChildCount;
mComponent->EnableParallax(child, ratio, child->Position());
}
示例2:
FOR_EACH_SIZE(i, mChildCount)
{
Sprite* child = NodeFactory::Instance().CreateSprite("test2.png");
child->SetAnchorPoint(AnchorPoint::MiddleTop);
child->SetPosition(mainSprite->Position());
child->MoveY(-child->Height()*(i + 1));
normalLayer->AddChild(child);
Point3F ratio = Point3F::One;
ratio.X = (float)(mChildCount-i) / mChildCount;
mComponent->EnableParallax(child, ratio, child->Position());
}