Struct GameEventButtonPosition
Represents the position and size of a game event button within a canvas, including its horizontal and vertical alignment, position, icon size, and background frame size.
public struct GameEventButtonPosition : IEquatable<GameEventButtonPosition>
- Implements
- Inherited Members
- Extension Methods
Constructors
GameEventButtonPosition()
public GameEventButtonPosition()
GameEventButtonPosition(int, HorizontalAlignment, VerticalAlignment, DoublePosition, DoubleSize, DoubleSize)
Initializes a new instance of the GameEventButtonPosition struct with the specified version, horizontal alignment, vertical alignment, position, icon size, and frame size.
public GameEventButtonPosition(int version, HorizontalAlignment horizontalAlignment, VerticalAlignment verticalAlignment, DoublePosition position, DoubleSize iconSize, DoubleSize frameSize)
Parameters
versionintThe version of the game event button position.
horizontalAlignmentHorizontalAlignmentThe horizontal alignment of the game event button.
verticalAlignmentVerticalAlignmentThe vertical alignment of the game event button.
positionDoublePositionThe position of the game event button within the canvas.
iconSizeDoubleSizeThe size of the game event button's icon.
frameSizeDoubleSizeThe size of the background frame.
Fields
Version
public readonly int Version
Field Value
_frameSize
public DoubleSize _frameSize
Field Value
_horizontalAlignment
public HorizontalAlignment _horizontalAlignment
Field Value
_iconSize
public DoubleSize _iconSize
Field Value
_position
public DoublePosition _position
Field Value
_verticalAlignment
public VerticalAlignment _verticalAlignment
Field Value
Properties
Default
Gets the default GameEventButtonPosition instance with predefined values for miHoYo/HoYoverse game event button position in HoYoPlay Launcher.
public static GameEventButtonPosition Default { get; }
Property Value
Empty
Gets an empty GameEventButtonPosition instance with all fields set to their default values (sets to 0).
public static GameEventButtonPosition Empty { get; }
Property Value
FrameSize
Gets the size of the background canvas.
public DoubleSize FrameSize { get; init; }
Property Value
HorizontalAlignment
Gets the horizontal alignment of the game event button.
[JsonConverter(typeof(JsonStringEnumConverter<HorizontalAlignment>))]
public HorizontalAlignment HorizontalAlignment { get; init; }
Property Value
IconSize
Gets the size of the game event button's icon, defined by its width and height. The width or height can be set to NaN to automatically adjust its size based on respecting aspect ratio.
public DoubleSize IconSize { get; init; }
Property Value
IsEmpty
Whether the GameEventButtonPosition is empty and all the fields are set to default values.
[JsonIgnore]
public bool IsEmpty { get; }
Property Value
Position
Gets the position of the game event button within the canvas, defined by its left, top, right, and bottom coordinates respecting the background's FrameSize. This property, though, can be referred as margin of the button.
public DoublePosition Position { get; init; }
Property Value
VerticalAlignment
Gets the vertical alignment of the game event button.
[JsonConverter(typeof(JsonStringEnumConverter<VerticalAlignment>))]
public VerticalAlignment VerticalAlignment { get; init; }
Property Value
Methods
Equals(GameEventButtonPosition)
Determines whether the specified GameEventButtonPosition is equal to the current instance by comparing all its fields.
public bool Equals(GameEventButtonPosition other)
Parameters
otherGameEventButtonPositionThe GameEventButtonPosition to compare with the current instance.
Returns
- bool
trueif the specified GameEventButtonPosition is equal to the current instance; otherwise,false.
Equals(object?)
Determines whether the specified object is equal to the current instance by checking if it is a GameEventButtonPosition and then comparing all its fields.
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare with the current instance.
Returns
- bool
trueif the specified object is a GameEventButtonPosition and is equal to the current instance; otherwise,false.
GetHashCode()
Returns a hash code for the current instance by combining the hash codes of all its fields.
public override int GetHashCode()
Returns
- int
A hash code for the current instance.
Operators
operator ==(GameEventButtonPosition, GameEventButtonPosition)
Determines whether two specified GameEventButtonPosition instances are equal by comparing all their fields.
public static bool operator ==(GameEventButtonPosition left, GameEventButtonPosition right)
Parameters
leftGameEventButtonPositionThe first GameEventButtonPosition to compare.
rightGameEventButtonPositionThe second GameEventButtonPosition to compare.
Returns
- bool
trueif the two GameEventButtonPosition instances are equal; otherwise,false.
operator !=(GameEventButtonPosition, GameEventButtonPosition)
Determines whether two specified GameEventButtonPosition instances are not equal by comparing all their fields.
public static bool operator !=(GameEventButtonPosition left, GameEventButtonPosition right)
Parameters
leftGameEventButtonPositionThe first GameEventButtonPosition to compare.
rightGameEventButtonPositionThe second GameEventButtonPosition to compare.
Returns
- bool
trueif the two GameEventButtonPosition instances are not equal; otherwise,false.