Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/xjine/unity_screenutil
- Owner: XJINE
- License: bsd-3-clause
- Created: 2019-04-22T02:50:46.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2022-06-24T09:04:45.000Z (over 2 years ago)
- Last Synced: 2024-03-20T20:12:35.827Z (9 months ago)
- Topics: assets, unity
- Language: C#
- Homepage:
- Size: 23.4 KB
- Stars: 7
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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;
```