Class FullScreenOverlay
Definition
Namespace: StardewUI.Overlays
Assembly: StardewUI.dll
Base class for an overlay meant to take up the full screen.
Inheritance
Object ⇦ FullScreenOverlay
Implements
IOverlay
Members
Constructors
Name | Description |
---|---|
FullScreenOverlay() | Initializes a new instance of FullScreenOverlay. |
Properties
Name | Description |
---|---|
CapturingInput | Whether the overlay wants to capture all keyboard and gamepad inputs, i.e. prevent them from being dispatched to the parent menu. |
DimmingAmount | Amount to dim whatever is underneath the overlay. |
HorizontalAlignment | Horizontal alignment of the overlay relative to the Parent edge. |
HorizontalParentAlignment | Specifies which edge of the Parent (or screen, if no parent is specified) will be used to align the overlay edge denoted by its HorizontalAlignment. |
Parent | The parent of this overlay, used for positioning. If not specified, then the overlay will be positioned relative to the entire UI viewport. |
ParentOffset | Additional pixel offset to apply to the overlay's position, after alignments. |
VerticalAlignment | Vertical alignment of the overlay relative to the Parent edge. |
VerticalParentAlignment | Specifies which edge of the Parent (or screen, if no parent is specified) will be used to align the overlay edge denoted by its VerticalAlignment. |
View | The view to be displayed/interacted with as an overlay. |
Methods
Name | Description |
---|---|
CreateView() | Creates the content view that will be displayed as an overlay. |
OnClose() | Runs when the overlay is removed from the active stack. |
RequireView<TChild>(Func<TChild>) | Ensures that the overlay view is created before attempting to access a child view. |
Update(TimeSpan) | Runs on every game update tick. |
Events
Name | Description |
---|---|
Close | Event raised when the overlay is closed - i.e. removed from the current context stack. |
Details
Constructors
FullScreenOverlay()
Initializes a new instance of FullScreenOverlay.
Properties
CapturingInput
Whether the overlay wants to capture all keyboard and gamepad inputs, i.e. prevent them from being dispatched to the parent menu.
Property Value
Remarks
This is not necessary to trap focus, which happens automatically; only to capture buttons/keys that would normally have a navigation function, like triggers/shoulders for paging, E/Esc/GamepadB for cancellation, etc. Overlays that enable capturing should provide their own way for the user to escape using keyboard/gamepad, although it is always possible to click the mouse outside the overlay to dismiss it (and implicitly stop the capturing).
DimmingAmount
Amount to dim whatever is underneath the overlay.
Property Value
Remarks
This is an alpha value for a black overlay, so the higher value (between 0 and 1) the darker the content underneath the overlay. These apply individually to each overlay, so multiple stacked overlays will dim not only the underlying main view but also any previous overlays.
HorizontalAlignment
Horizontal alignment of the overlay relative to the Parent edge.
Property Value
Remarks
Full-screen overlays should generally stretch to the entire viewport dimensions, but are middle-aligned in case of a discrepancy.
HorizontalParentAlignment
Specifies which edge of the Parent (or screen, if no parent is specified) will be used to align the overlay edge denoted by its HorizontalAlignment.
Property Value
Remarks
Full-screen overlays should generally stretch to the entire viewport dimensions, but are middle-aligned in case of a discrepancy.
Parent
The parent of this overlay, used for positioning. If not specified, then the overlay will be positioned relative to the entire UI viewport.
Property Value
Remarks
Full-screen overlays always have a null
parent.
ParentOffset
Additional pixel offset to apply to the overlay's position, after alignments.
Property Value
VerticalAlignment
Vertical alignment of the overlay relative to the Parent edge.
Property Value
Remarks
Full-screen overlays should generally stretch to the entire viewport dimensions, but are middle-aligned in case of a discrepancy.
VerticalParentAlignment
Specifies which edge of the Parent (or screen, if no parent is specified) will be used to align the overlay edge denoted by its VerticalAlignment.
Property Value
Remarks
Full-screen overlays should generally stretch to the entire viewport dimensions, but are middle-aligned in case of a discrepancy.
View
The view to be displayed/interacted with as an overlay.
Property Value
Remarks
The view provided in a full-screen overlay is a dimming frame with the content view inside.
Methods
CreateView()
Creates the content view that will be displayed as an overlay.
Returns
OnClose()
Runs when the overlay is removed from the active stack.
RequireView<TChild>(Func<TChild>)
Ensures that the overlay view is created before attempting to access a child view.
Parameters
viewSelector
Func<TChild>
Function to retrieve the inner view.
Returns
TChild
The inner view.
Remarks
This is syntactic sugar over accessing View first to force lazy loading.
Update(TimeSpan)
Runs on every game update tick.
Parameters
elapsed
TimeSpan
The amount of real time elapsed since the last tick.
Events
Close
Event raised when the overlay is closed - i.e. removed from the current context stack.