本文整理汇总了C++中Sprite::AddTransformation方法的典型用法代码示例。如果您正苦于以下问题:C++ Sprite::AddTransformation方法的具体用法?C++ Sprite::AddTransformation怎么用?C++ Sprite::AddTransformation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sprite
的用法示例。
在下文中一共展示了Sprite::AddTransformation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ResetSprite
int32 ResetSprite(void *systemData, void *userData)
{
GameManager *mgr;
if(systemData != NULL)
{
Sprite *spritePtr = (Sprite *)systemData;
mgr = spritePtr->GetManager();
mgr->RemoveGameObject(spritePtr);
delete spritePtr;
}
else
{
mgr = (GameManager*)userData;
}
Sprite *tmp = new Sprite(mgr);
tmp->SetImage(mgr->GetResourceManager()->GetImage(ARROW_HANDLE));
tmp->SetBaseLocation(CIwVec2(mgr->GetSurfaceWidth() / 2, mgr->GetSurfaceHeight() / 2));
tmp->AddTransformation(new AnchorTransformation());
OrbitTransformation *orbiter = new OrbitTransformation(150, 5000, 0, Clockwise);
tmp->AddTransformation(orbiter);
mgr->RegisterGameObject(tmp);
tmp->SetLifespan(++resetCount * 500);
tmp->SetCompletionCallback(ResetSprite, NULL);
return 0;
}
示例2: LabeledSprite
void LabeledSprite(GameManager *mgr, uint32 marker_handle, uint32 width, uint32 height)
{
Sprite *image = new Sprite(mgr);
image->SetImage(mgr->GetResourceManager()->GetImage(ARROW_HANDLE));
image->AddTransformation(new AnchorTransformation());
image->SetBaseLocation(CIwVec2(mgr->GetSurfaceWidth() / 2, mgr->GetSurfaceHeight() / 2));
OrbitTransformation *orbiter = new OrbitTransformation(150, 5000, 0, CounterClockwise);
image->AddTransformation(orbiter);
mgr->RegisterGameObject(image);
TextSprite *text = new TextSprite(mgr, (char *)"Normal");
text->AddTransformation(new AnchorTransformation());
text->AddTransformation(new AnchorToTransformation(image, image, (float)(text->GetHeight() / 2 + image->GetHeight() / 2 + 10), 0, RelativeToNormal));
text->AddTransformation(new OrientToTransformation((IDirectional*)image, OrientAlongOrientation));
mgr->RegisterGameObject(text);
}