Class PositioningOverlay
Definition
Namespace: StardewUI.Widgets
Assembly: StardewUI.dll
An overlay that can be used to edit the position of some arbitrary content.
Inheritance
Object ⇦ FullScreenOverlay ⇦ PositioningOverlay
Remarks
Note that the widget only provides a means to visually/interactively obtain a new position, similar to e.g. obtaining a text string from a modal input query. It is up to the caller to persist the resulting ContentPlacement to configuration and determine how to actually position the content in its usual context (e.g. game HUD).
Members
Constructors
Name | Description |
---|---|
PositioningOverlay(ISpriteMap<SButton>, ISpriteMap<Direction>) | An overlay that can be used to edit the position of some arbitrary content. |
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. (Inherited from FullScreenOverlay) |
Content | The content that is being positioned. |
ContentPlacement | Current placement of the Content within the viewport. |
DimmingAmount | Amount to dim whatever is underneath the overlay. (Inherited from FullScreenOverlay) |
GamepadControls | The control scheme to use when positioning with a gamepad. |
HorizontalAlignment | Horizontal alignment of the overlay relative to the Parent edge. (Inherited from FullScreenOverlay) |
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. (Inherited from FullScreenOverlay) |
KeyboardControls | The control scheme to use when positioning with keyboard/mouse. |
Parent | The parent of this overlay, used for positioning. If not specified, then the overlay will be positioned relative to the entire UI viewport. (Inherited from FullScreenOverlay) |
ParentOffset | Additional pixel offset to apply to the overlay's position, after alignments. (Inherited from FullScreenOverlay) |
VerticalAlignment | Vertical alignment of the overlay relative to the Parent edge. (Inherited from FullScreenOverlay) |
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. (Inherited from FullScreenOverlay) |
View | The view to be displayed/interacted with as an overlay. (Inherited from FullScreenOverlay) |
Methods
Name | Description |
---|---|
CreateView() | Creates the content view that will be displayed as an overlay. (Overrides FullScreenOverlay.CreateView()) |
OnClose() | Runs when the overlay is removed from the active stack. (Inherited from FullScreenOverlay) |
RequireView<TChild>(Func<TChild>) | Ensures that the overlay view is created before attempting to access a child view. (Inherited from FullScreenOverlay) |
Update(TimeSpan) | Runs on every game update tick. (Inherited from FullScreenOverlay) |
Events
Name | Description |
---|---|
Close | Event raised when the overlay is closed - i.e. removed from the current context stack. (Inherited from FullScreenOverlay) |
Details
Constructors
PositioningOverlay(ISpriteMap<SButton>, ISpriteMap<Direction>)
An overlay that can be used to edit the position of some arbitrary content.
public PositioningOverlay(StardewUI.Graphics.ISpriteMap<StardewModdingAPI.SButton> buttonSpriteMap, StardewUI.Graphics.ISpriteMap<StardewUI.Direction> directionSpriteMap);
Parameters
buttonSpriteMap
ISpriteMap
Map of buttons to button prompt sprites.
directionSpriteMap
ISpriteMap<Direction>
Map of directions to directional arrow sprites; used to indicate dragging.
Remarks
Note that the widget only provides a means to visually/interactively obtain a new position, similar to e.g. obtaining a text string from a modal input query. It is up to the caller to persist the resulting ContentPlacement to configuration and determine how to actually position the content in its usual context (e.g. game HUD).
Properties
Content
The content that is being positioned.
Property Value
Remarks
This is normally a "representative" version of the real content, as the true HUD widget or other element may not exist or have its properties known at configuration time.
ContentPlacement
Current placement of the Content within the viewport.
Property Value
GamepadControls
The control scheme to use when positioning with a gamepad.
Property Value
KeyboardControls
The control scheme to use when positioning with keyboard/mouse.
Property Value
Methods
CreateView()
Creates the content view that will be displayed as an overlay.