Struct DisplayInfo
- Namespace
- Cobilas.GodotEngine.Utility
- Assembly
- com.cobilas.godot.utility.dll
Contains information from a specific screen.
public readonly struct DisplayInfo : IEquatable<DisplayInfo>
- Implements
- Inherited Members
Constructors
DisplayInfo(in int, in DisplayDevice?)
Starts a new instance of the object.
public DisplayInfo(in int index, in DisplayDevice? device)
Parameters
indexintThe monitor index.
deviceDisplayDeviceThe OpenTK.DisplayDevice that contains the screen information.
Properties
CurrentResolution
Current screen resolution.
public Resolution CurrentResolution { get; }
Property Value
- Resolution
Returns the current resolution of this OpenTK.DisplayDevice.
CustonResolutions
The list of custom resolutions.
public CustonResolutionList CustonResolutions { get; }
Property Value
- CustonResolutionList
Returns a list of custom resolutions from DisplayInfo.
Index
Screen index
public int Index { get; }
Property Value
- int
Returns the screen index.
None
Empty display.
public static DisplayInfo None { get; }
Property Value
- DisplayInfo
Returns an empty instance of DisplayInfo.
Resolutions
Screen resolutions.
public Resolution[] Resolutions { get; }
Property Value
- Resolution[]
Returns all resolutions supported by the display.
Methods
AddCustonResolution(in Resolution, in DisplayInfo)
Adds a custom resolution to DisplayInfo.
public static DisplayInfo AddCustonResolution(in Resolution resolution, in DisplayInfo display)
Parameters
resolutionResolutionThe resolution to be added.
displayDisplayInfoThe target DisplayInfo.
Returns
- DisplayInfo
Returns a new, modified instance of DisplayInfo.
ChangeCurrentResolution(in Resolution, in DisplayInfo)
Allows you to change the current resolution of this display.
public static DisplayInfo ChangeCurrentResolution(in Resolution resolution, in DisplayInfo display)
Parameters
resolutionResolutionThe new resolution.
displayDisplayInfoThe target DisplayInfo.
Returns
- DisplayInfo
Returns a new, modified instance of DisplayInfo.
Contains(in Resolution, in bool)
Allows you to check whether a certain resolution exists on this display.
public bool Contains(in Resolution resolution, in bool includeCustomResolution = false)
Parameters
resolutionResolutionTarget resolution.
includeCustomResolutionboolTells the method whether to compare with the custom resolution list.
Returns
- bool
If the resolution exists, it will return
true.
Equals(DisplayInfo)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(DisplayInfo other)
Parameters
otherDisplayInfoAn object to compare with this object.
Returns
Equals(object)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object obj)
Parameters
objobjectThe object to compare with the current instance.
Returns
- bool
true if
objand this instance are the same type and represent the same value; otherwise, false.
GetHash(in DisplayInfo)
Generates a hash from DisplayInfo.
public static int GetHash(in DisplayInfo display)
Parameters
displayDisplayInfoThe object that will be used.
Returns
- int
Returns a hash generated from the DisplayInfo index and resolution list.
GetHashCode()
Returns the hash code for this instance.
public override int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
Operators
operator ==(DisplayInfo, DisplayInfo)
Indicates whether this instance is equal to another instance of the same type.
public static bool operator ==(DisplayInfo A, DisplayInfo B)
Parameters
ADisplayInfoObject to be compared.
BDisplayInfoObject of comparison.
Returns
- bool
Returns the result of the comparison.
operator !=(DisplayInfo, DisplayInfo)
Indicates whether this instance is different from another instance of the same type.
public static bool operator !=(DisplayInfo A, DisplayInfo B)
Parameters
ADisplayInfoObject to be compared.
BDisplayInfoObject of comparison.
Returns
- bool
Returns the result of the comparison.