本文整理汇总了C++中Animation::Set方法的典型用法代码示例。如果您正苦于以下问题:C++ Animation::Set方法的具体用法?C++ Animation::Set怎么用?C++ Animation::Set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Animation
的用法示例。
在下文中一共展示了Animation::Set方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Initialise
/*!
\brief Set up Zoom transition
*/
void TransitionZoom::Initialise()
{
// Both images are same size
int width = m_old->GetArea().width();
// Zoom away to left
Animation *oldZoom = new Animation(m_prev, Animation::Zoom);
oldZoom->Set(1.0, 0.0, m_duration, QEasingCurve::OutQuad);
m_animation->Add(oldZoom);
Animation *oldMove = new Animation(m_prev, Animation::Position);
oldMove->Set(QPoint(0, 0), QPoint(-width / 2, 0), m_duration,
QEasingCurve::InQuad);
m_animation->Add(oldMove);
// Zoom in from right
Animation *newZoom = new Animation(m_next, Animation::Zoom);
newZoom->Set(0.0, 1.0, m_duration, QEasingCurve::InQuad);
m_animation->Add(newZoom);
Animation *newMove = new Animation(m_next, Animation::Position);
newMove->Set(QPoint(width / 2, 0), QPoint(0, 0), m_duration,
QEasingCurve::OutQuad);
m_animation->Add(newMove);
// Hide new image until it's needed
m_new->SetZoom(0.0);
}
示例2: InitAnimation
void CEnemySuperRetardZombie::InitAnimation()
{
Animation* cAnim;
cAnim = new Animation();
cAnim->Set(1, 1, 0, 0.f);
AddAnimation(cAnim, DIR_IDLE_DOWN);
//Idle East
cAnim = new Animation();
cAnim->Set(4, 4, 0, 0.f);
AddAnimation(cAnim, DIR_IDLE_LEFT);
//Idle East
cAnim = new Animation();
cAnim->Set(7, 7, 0, 0.f);
AddAnimation(cAnim, DIR_IDLE_RIGHT);
//Idle North
cAnim = new Animation();
cAnim->Set(10, 10, 0, 0.f);
AddAnimation(cAnim, DIR_IDLE_UP);
//Walk South
cAnim = new Animation();
cAnim->Set(0, 2, 0, 0.8f);
AddAnimation(cAnim, DIR_DOWN);
//Walk East
cAnim = new Animation();
cAnim->Set(3, 5, 0, 0.4f);
AddAnimation(cAnim, DIR_LEFT);
//Walk East
cAnim = new Animation();
cAnim->Set(6, 8, 0, 0.4f);
AddAnimation(cAnim, DIR_RIGHT);
//Walk North
cAnim = new Animation();
cAnim->Set(9, 11, 0, 0.4f);
AddAnimation(cAnim, DIR_UP);
}
示例3: processMesh
void ResourcePool::processMesh(string config)
{
Branch meshBranch = TextTree::FileToRead(config);
for (vector<Branch>::iterator branch = meshBranch.childBranches.begin(); branch != meshBranch.childBranches.end(); ++branch)
{
string meshName = branch->branchName;
Color meshColor;
enum MISC_VARIABLE
{
VAR_LENGTH,
VAR_WIDTH,
VAR_HEIGHT,
VAR_RADIUS,
VAR_INNER_RADIUS,
VAR_OUTER_RADIUS,
VAR_SLICES,
VAR_STACKS,
VAR_ANIM_TIME,
MAX_VAR,
};
float meshVar[MAX_VAR];
for (int i = 0; i < MAX_VAR; ++i)
{
meshVar[i] = 1.0f;
}
string meshVarNames[MAX_VAR] =
{
"Length",
"Width",
"Height",
"Radius",
"InnerRadius",
"OuterRadius",
"Slices",
"Stacks",
};
// default 2D mesh variables
int meshPosX = 0;
int meshPosY = 0;
int meshTextRow = 0;
int meshTextCol = 0;
// Spirte Animation
int meshSpriteRow = 0;
int meshSpriteCol = 0;
// Tile sheet
int meshTileRow = 0;
int meshTileCol = 0;
string directory = "";
string meshType = "";
unsigned textureID = 0;
for (vector<Attribute>::iterator attri = branch->attributes.begin(); attri != branch->attributes.end(); ++attri)
{
Attribute tempAttri = *attri;
string attriName = tempAttri.name;
string attriValue = tempAttri.value;
if (attriName == "ColorValue")
{
Vector3 tempColor;
stringToVector(attriValue, tempColor);
meshColor.Set(tempColor.x, tempColor.y, tempColor.z);
}
if (attriName == "ColorName")
{
meshColor = retrieveColor(attriValue);
}
else if (attriName == "Type")
{
meshType = attriValue;
}
else if (attriName == "Texture")
{
textureID = this->retrieveTexture(attriValue);
}
else if (attriName == "Directory")
{
directory = attriValue;
}
else if (attriName == "SpriteRow")
{
meshSpriteRow = stoi(attriValue);
}
//.........这里部分代码省略.........