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
index
intThe monitor index.
device
DisplayDeviceThe 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
resolution
ResolutionThe resolution to be added.
display
DisplayInfoThe 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
resolution
ResolutionThe new resolution.
display
DisplayInfoThe 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
resolution
ResolutionTarget resolution.
includeCustomResolution
boolTells 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
other
DisplayInfoAn 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
obj
objectThe object to compare with the current instance.
Returns
- bool
true if
obj
and 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
display
DisplayInfoThe 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
A
DisplayInfoObject to be compared.
B
DisplayInfoObject 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
A
DisplayInfoObject to be compared.
B
DisplayInfoObject of comparison.
Returns
- bool
Returns the result of the comparison.