本文整理汇总了C++中VideoPtr::MoveCamera方法的典型用法代码示例。如果您正苦于以下问题:C++ VideoPtr::MoveCamera方法的具体用法?C++ VideoPtr::MoveCamera怎么用?C++ VideoPtr::MoveCamera使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VideoPtr
的用法示例。
在下文中一共展示了VideoPtr::MoveCamera方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Update
void PlayerManager::Update(VideoPtr video, InputPtr input, ShootManagerPtr shootManager, SpritePtr playerSprite, SpritePtr shootSprite)
{
static Vector2 hitPos, releasePos;
static int turn = 0;
if (input->GetTouchState(0) == GSKS_HIT)
{
if (IsInArea(GetAbsolutePos(input, video), Rect2Df(GetPlayer(turn)->GetPos(), playerSprite->GetRect().size), Vector2(0.5f, 0.5f), video))
{
hitPos = input->GetTouchPos(0, video);
}
else
{
hitPos = GS_NO_TOUCH;
}
}
if (input->GetTouchState(0) == GSKS_DOWN)
{
releasePos = hitPos - input->GetTouchPos(0, video);
}
if (input->GetTouchState(0) == GSKS_RELEASE && hitPos != GS_NO_TOUCH)
{
{
Vector2 pos = m_simulator->GetPosition(GetPlayer(turn)->GetBodyId());
shootManager->Shoot(pos, turn, releasePos);
turn = !turn;
}
}
if (hitPos == GS_NO_TOUCH)
{
video->MoveCamera(input->GetTouchMove(0) * -1);
}
}
示例2: AddToCameraPos
void ETHScriptWrapper::AddToCameraPos(const Vector2 &v2Add)
{
if (WarnIfRunsInMainFunction(GS_L("AddToCameraPos")))
return;
// rounds up camera final position
VideoPtr video = m_provider->GetVideo();
video->RoundUpPosition(m_roundUpPosition);
video->MoveCamera(m_provider->GetGlobalScaleManager()->Scale(v2Add));
video->RoundUpPosition(false);
}