Class Viewport
Represents a viewport used in graphics rendering.
Inherited Members
Namespace: Genesis.Graphics
Assembly: Genesis.dll
Syntax
public class Viewport
Constructors
Viewport()
Default constructor for the Viewport class.
Declaration
public Viewport()
Viewport(float, float)
Constructor for the Viewport class that initializes the viewport with a specified width and height.
Declaration
public Viewport(float width, float height)
Parameters
Type | Name | Description |
---|---|---|
float | width | The width of the viewport. |
float | height | The height of the viewport. |
Viewport(float, float, float, float)
Constructor for the Viewport class that initializes the viewport with a specified X-coordinate, Y-coordinate, width, and height.
Declaration
public Viewport(float x, float y, float width, float height)
Parameters
Type | Name | Description |
---|---|---|
float | x | The X-coordinate of the viewport. |
float | y | The Y-coordinate of the viewport. |
float | width | The width of the viewport. |
float | height | The height of the viewport. |
Properties
Height
Gets or sets the height of the viewport.
Declaration
public float Height { get; set; }
Property Value
Type | Description |
---|---|
float |
Width
Gets or sets the width of the viewport.
Declaration
public float Width { get; set; }
Property Value
Type | Description |
---|---|
float |
X
Gets or sets the X-coordinate of the viewport.
Declaration
public float X { get; set; }
Property Value
Type | Description |
---|---|
float |
Y
Gets or sets the Y-coordinate of the viewport.
Declaration
public float Y { get; set; }
Property Value
Type | Description |
---|---|
float |
Methods
GetSize()
Gets the size of the viewport as a System.Drawing.Size.
Declaration
public Size GetSize()
Returns
Type | Description |
---|---|
Size | The size of the viewport as a System.Drawing.Size. |
GetSizeF()
Gets the size of the viewport as a System.Drawing.SizeF.
Declaration
public SizeF GetSizeF()
Returns
Type | Description |
---|---|
SizeF | The size of the viewport as a System.Drawing.SizeF. |
SetNewViewport(float, float)
Sets a new width and height for the viewport.
Declaration
public void SetNewViewport(float width, float height)
Parameters
Type | Name | Description |
---|---|---|
float | width | The new width of the viewport. |
float | height | The new height of the viewport. |