Add binding for GetScreenToWorld2D

This commit is contained in:
Tobias Giess 2020-04-11 13:46:52 +02:00
parent 8f46e31841
commit ee8229b508

View file

@ -296,6 +296,15 @@ func GetWorldToScreen2D(position Vector2, camera Camera2D) Vector2 {
return v 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) // GetCameraMatrix - Returns camera transform matrix (view matrix)
func GetCameraMatrix(camera Camera) Matrix { func GetCameraMatrix(camera Camera) Matrix {
ccamera := camera.cptr() ccamera := camera.cptr()