From ee8229b5083292212c79fe4a0f5943ee174f666e Mon Sep 17 00:00:00 2001 From: Tobias Giess Date: Sat, 11 Apr 2020 13:46:52 +0200 Subject: [PATCH] Add binding for GetScreenToWorld2D --- raylib/core.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/raylib/core.go b/raylib/core.go index 7a9b4e3..10c5c28 100644 --- a/raylib/core.go +++ b/raylib/core.go @@ -296,6 +296,15 @@ func GetWorldToScreen2D(position Vector2, camera Camera2D) Vector2 { return v } +// GetScreenToWorld2D - Returns the world space position for a 2d camera screen space position +func GetScreenToWorld2D(position Vector2, camera Camera2D) Vector2 { + cposition := position.cptr() + ccamera := camera.cptr() + ret := C.GetScreenToWorld2D(*cposition, *ccamera) + v := newVector2FromPointer(unsafe.Pointer(&ret)) + return v +} + // GetCameraMatrix - Returns camera transform matrix (view matrix) func GetCameraMatrix(camera Camera) Matrix { ccamera := camera.cptr()