Move ScreenToGameViewport from Engine to Screen

And make it accessible from the C# side
This commit is contained in:
stefnotch
2021-03-15 20:18:39 +01:00
parent 97ab226d7e
commit fb28cae2b4
5 changed files with 34 additions and 34 deletions

View File

@@ -339,14 +339,14 @@ bool Input::GetKeyUp(const KeyboardKeys key)
Vector2 Input::GetMousePosition()
{
return Mouse ? Engine::ScreenToGameViewport(Mouse->GetPosition()) : Vector2::Minimum;
return Mouse ? Screen::ScreenToGameViewport(Mouse->GetPosition()) : Vector2::Minimum;
}
void Input::SetMousePosition(const Vector2& position)
{
if (Mouse && Engine::HasGameViewportFocus())
{
const auto pos = Engine::GameViewportToScreen(position);
const auto pos = Screen::GameViewportToScreen(position);
if (pos > Vector2::Minimum)
Mouse->SetMousePosition(pos);
}