Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/xjine/unity_screenutil

Convert between viewport-coord and screen-coord, and, any others.
https://github.com/xjine/unity_screenutil

assets unity

Last synced: 13 days ago
JSON representation

Convert between viewport-coord and screen-coord, and, any others.

Awesome Lists containing this project

README

        

# Unity_ScreenUtil

Convert between viewport-coord and screen-coord, and, any others.

## Importing

You can use Package Manager or import it directly.

```
https://github.com/XJINE/Unity_ScreenUtil.git?path=Assets/Packages/ScreenUtil
```

## How to use

``` csharp
ScreenUtil.ViewportToScreen(Vector2 coord)
ScreenUtil.ViewportToScreen(float coordX, float coordY)
ScreenUtil.ScreenToViewport(Vector2Int coord)
ScreenUtil.ScreenToViewport(int coordX, int coordY)
ScreenUtil.AspectRatio;
```