MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / ScreenToGameViewport

Method ScreenToGameViewport

Source/Engine/Engine/Screen.cpp:78–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76}
77
78Float2 Screen::ScreenToGameViewport(const Float2& screenPos)
79{
80#if USE_EDITOR
81 return Editor::Managed->ScreenToGameViewport(screenPos);
82#else
83 auto win = Engine::MainWindow;
84 return win ? win->ScreenToClient(screenPos) / win->GetDpiScale() : Float2::Minimum;
85#endif
86}
87
88Float2 Screen::GameViewportToScreen(const Float2& viewportPos)
89{

Callers

nothing calls this directly

Calls 2

GetDpiScaleMethod · 0.80
ScreenToClientMethod · 0.45

Tested by

no test coverage detected