This topic was marked solved by its starter, on August 28th, 2021, 08:02 AM

#### ℛḝξ☂

• Full Member
• Posts: 107
##### Client function ScreenPosToWorld
«  »
GUI::ScreenPosToWorld(Vector screenPosition)

I wonder how this function works, and why the parameter screen position is Vector instead of VectorScreen, any help is appreciated!
I may be a slow walker but I am always walking.

#### Xmair

• Wiki Contributor
• Posts: 960
##### Re: Client function ScreenPosToWorld
This function is used to convert the world's 3D co-ordinates to the client's 2D screen co-ordinates.

Credits to Boystang!

VU Full Member | VCDC 6 Coordinator & Scripter | EG A/D Contributor | Developer of VCCNR | Developer of KTB | Ex-Scripter of EAD

#### DizzasTeR

• VC:MP Beta Tester
• Infinite loops defy infinity by overflowing memory
• Posts: 1,211
##### Re: Client function ScreenPosToWorld
Quote from Xmair on August 24th, 2021, 06:43 AM
This function is used to convert the world's 3D co-ordinates to the client's 2D screen co-ordinates.
Its the other way around. The Z parameter in Screen -> World Pos or World Pos -> Screen represents visibility. Value is between -1 or 0 (forgot exactly) if the vector is not visible on screen and anything else if it is. (You probably have to test)

#### Xmair

• Wiki Contributor
• Posts: 960
##### Re: Client function ScreenPosToWorld
Quote from DizzasTeR on August 24th, 2021, 10:21 AM
Quote from Xmair on August 24th, 2021, 06:43 AM
This function is used to convert the world's 3D co-ordinates to the client's 2D screen co-ordinates.
Its the other way around. The Z parameter in Screen -> World Pos or World Pos -> Screen represents visibility. Value is between -1 or 0 (forgot exactly) if the vector is not visible on screen and anything else if it is. (You probably have to test)
My bad, didn't read the function name closely. If the Z coordinate is in negative, the vector is formed behind the player's screen (from my last experiment)

Credits to Boystang!

VU Full Member | VCDC 6 Coordinator & Scripter | EG A/D Contributor | Developer of VCCNR | Developer of KTB | Ex-Scripter of EAD

• Full Member
• Posts: 107