Tanoda
PPIViewer.cs
Go to the documentation of this file.
1
3
4
/*USAGE:
5
Simply place the script on A Text control in the scene to display the current PPI / DPI of the screen*/
6
7
namespace
UnityEngine.UI.Extensions
8
{
9
[RequireComponent(typeof(Text))]
10
[AddComponentMenu(
"UI/Extensions/PPIViewer"
)]
11
public
class
PPIViewer
: MonoBehaviour
12
{
13
private
Text label;
14
15
void
Awake()
16
{
17
label = GetComponent<Text>();
18
}
19
20
void
Start()
21
{
22
if
(label !=
null
)
23
{
24
label.text =
"PPI: "
+ Screen.dpi.ToString();
25
}
26
}
27
}
28
}
UnityEngine.UI.Extensions.PPIViewer
Definition:
PPIViewer.cs:12
UnityEngine.UI.Extensions
Credit Erdener Gonenc - @PixelEnvision.
Definition:
AccordionElementEditor.cs:8
Source
Assets
unity-ui-extensions
Runtime
Scripts
Utilities
PPIViewer.cs
Generated by
1.9.3