本文整理汇总了C++中Part::GetSprite方法的典型用法代码示例。如果您正苦于以下问题:C++ Part::GetSprite方法的具体用法?C++ Part::GetSprite怎么用?C++ Part::GetSprite使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Part
的用法示例。
在下文中一共展示了Part::GetSprite方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Update
void PuppetEditor::Update()
{
Editor::Update();
if (isEnabled)
{
UpdateCamera();
timeline->currentAnimation = puppetEntity->puppet.GetCurrentAnimation();
Animation *anim = puppetEntity->puppet.GetCurrentAnimation();
if (Input::IsKeyPressed(keyTogglePause))
{
puppetEntity->puppet.TogglePause();
Debug::render = Debug::showBounds = puppetEntity->puppet.IsPaused();
if (!puppetEntity->puppet.IsPaused())
{
Debug::selectedEntity = NULL;
}
else
{
if (anim)
{
anim->SetCurrentTime(int(anim->GetCurrentTime()/TIME_STEP)*TIME_STEP);
}
}
}
if (puppetEntity->puppet.IsPaused())
{
if (Input::IsMouseButtonPressed(MOUSE_BUTTON_LEFT))
Debug::selectedEntity = scene->GetNearestEntityByControlPoint(Input::GetWorldMousePosition(), "", Debug::selectedEntity);
if (Input::IsKeyHeld(KEY_LCTRL))
{
if (Input::IsKeyPressed(KEY_S))
{
puppetEntity->puppet.Save();
}
}
if (Debug::selectedEntity)
{
Part *part = dynamic_cast<Part*>(Debug::selectedEntity);
float moveSpeed = 10.0f;
float rotateSpeed = 15.0f;
if (Input::IsKeyHeld(KEY_LSHIFT))
{
float multiplier = 5.0f;
moveSpeed *= multiplier;
rotateSpeed *= multiplier;
}
if (Input::IsKeyPressed(keyZero))
{
part->position = Vector2::zero;
part->rotation = 0.0f;
part->GetSprite()->position = Vector2::zero;
}
float moveAmount = Monocle::deltaTime * moveSpeed * 10.0f;
float rotateAmount = Monocle::deltaTime * rotateSpeed;
if (Input::IsKeyHeld(KEY_LCTRL))
{
}
else
{
if (Input::IsKeyHeld(keyOffset))
{
if (part)
{
Sprite *sprite = part->GetSprite();
if (Input::IsKeyHeld(keyMoveLeft))
sprite->position += Vector2::left * moveAmount;
if (Input::IsKeyHeld(keyMoveRight))
sprite->position += Vector2::right * moveAmount;
if (Input::IsKeyHeld(keyMoveUp))
sprite->position += Vector2::up * moveAmount;
if (Input::IsKeyHeld(keyMoveDown))
sprite->position += Vector2::down * moveAmount;
}
}
else
{
if (Input::IsKeyHeld(keyMoveLeft))
Debug::selectedEntity->position += Vector2::left * moveAmount;
if (Input::IsKeyHeld(keyMoveRight))
Debug::selectedEntity->position += Vector2::right * moveAmount;
if (Input::IsKeyHeld(keyMoveUp))
Debug::selectedEntity->position += Vector2::up * moveAmount;
if (Input::IsKeyHeld(keyMoveDown))
Debug::selectedEntity->position += Vector2::down * moveAmount;
}
if (Input::IsKeyHeld(keyRotateLeft))
//.........这里部分代码省略.........