Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
DisplayMode.cs
Go to the documentation of this file.
2
4
5public class DisplayMode
6{
7 internal int _width;
8
9 internal int _height;
10
12
14
15 public int Height => _height;
16
17 public int Width => _width;
18
19 public float AspectRatio
20 {
21 get
22 {
23 if (_height == 0 || _width == 0)
24 {
25 return 0f;
26 }
27 return (float)_width / (float)_height;
28 }
29 }
30
32
33 internal DisplayMode(int width, int height, SurfaceFormat format)
34 {
35 _width = width;
36 _height = height;
37 _format = format;
38 }
39
40 public override string ToString()
41 {
42 return string.Format(CultureInfo.CurrentCulture, "{{Width:{0} Height:{1} Format:{2} AspectRatio:{3}}}", _width, _height, Format, AspectRatio);
43 }
44}
DisplayMode(int width, int height, SurfaceFormat format)
static CultureInfo CurrentCulture
static Rectangle GetTitleSafeArea(int x, int y, int w, int h)
Definition Viewport.cs:195