Class Screen
Represents screen.
Events
onResolutionChanged
Called when resolution changed.
public event Action onResolutionChanged;
Properties
width
width of screen (pixel).
public int width { get; }
height
height of screen (pixel).
public int height { get; }
renderWidth
width of rendering area (pixel).
public int renderWidth { get; }
renderHeight
height of rendering area (pixel).
public int renderHeight { get; }
aspect
Aspect ratio of the screen (width / height).
public float aspect { get; }
renderAspect
Aspect ratio of the render area (width / height).
public float renderAspect { get; }
fixedAspectEnabled
Is fixed aspect ratio rendering enabled?
public bool fixedAspectEnabled { get; private set; }
resolution
Resolution of screen (pixel).
public Vector2Int resolution { get; }
renderResolution
Resolution of rendering area (pixel).
public Vector2Int renderResolution { get; }
Methods
GetResolutionScale(ResolutionScaleMode resolutionScaleMode)
public Vector2 GetResolutionScale(ResolutionScaleMode resolutionScaleMode)
Refresh()
public void Refresh()
EnableFixedAspect(float aspect)
public void EnableFixedAspect(float aspect)
EnableFixedAspect(float aspect, IFixedAspectRenderExecutor fixedAspectRenderExecutor)
Enable fixed aspect ratio rendering.
public void EnableFixedAspect(float aspect, IFixedAspectRenderExecutor fixedAspectRenderExecutor)
DisableFixedAspect()
public void DisableFixedAspect()
ScreenPointToRenderArea(Vector2 screenPoint)
public Vector2 ScreenPointToRenderArea(Vector2 screenPoint)
CaptureScreen()
public Task<RenderTexture> CaptureScreen()
CaptureScreen(RenderTexture renderTexture)
public Task CaptureScreen(RenderTexture renderTexture)
CaptureScreenAsTexture2D()
public Task<Texture2D> CaptureScreenAsTexture2D()