Description
The ResolutionWidth
property of the RenderSettings
class specifies the width of the screen resolution for rendering in pixels. This property is part of the Sandbox.Engine.Settings
namespace and is used to configure the horizontal resolution of the game display.
Usage
To use the ResolutionWidth
property, you need to access an instance of the RenderSettings
class. You can get or set this property to adjust the width of the rendering resolution. This is typically used in conjunction with ResolutionHeight
to define the full screen resolution.
Example
// Example of setting the ResolutionWidth property
RenderSettings renderSettings = new RenderSettings();
renderSettings.ResolutionWidth = 1920;
// Example of getting the ResolutionWidth property
int currentWidth = renderSettings.ResolutionWidth;
// Apply the settings to take effect
renderSettings.Apply();