Skip to content

Class ButtonSpriteMap

Definition

Namespace: StardewUI.Graphics
Assembly: StardewUI.dll

Base class for a ISpriteMap<T> for controller/keyboard bindings.

public class ButtonSpriteMap : 
    StardewUI.Graphics.ISpriteMap<StardewModdingAPI.SButton>

Inheritance
Object ⇦ ButtonSpriteMap

Implements
ISpriteMap

Members

Constructors

Name Description
ButtonSpriteMap()

Properties

Name Description
ControllerBlank A blank controller button upon which the specific button label can be drawn.
KeyboardBlank A blank keyboard key upon which the specific key name can be drawn.
MouseLeft The mouse with left button pressed.
MouseMiddle The mouse with middle button pressed.
MouseRight The mouse with right button pressed.

Methods

Name Description
Get(SButton, Boolean) Gets the sprite corresponding to a particular key.
Get(SButton) Gets the specific sprite for a particular button.

Details

Constructors

ButtonSpriteMap()

protected ButtonSpriteMap();

Properties

ControllerBlank

A blank controller button upon which the specific button label can be drawn.

protected StardewUI.Graphics.Sprite ControllerBlank { get; }
Property Value

Sprite

Remarks

If the sprite specifies non-zero FixedEdges then they will be added to the label's margin.


KeyboardBlank

A blank keyboard key upon which the specific key name can be drawn.

protected StardewUI.Graphics.Sprite KeyboardBlank { get; }
Property Value

Sprite

Remarks

If the sprite specifies non-zero FixedEdges then they will be added to the label's margin.


MouseLeft

The mouse with left button pressed.

protected StardewUI.Graphics.Sprite MouseLeft { get; }
Property Value

Sprite


MouseMiddle

The mouse with middle button pressed.

protected StardewUI.Graphics.Sprite MouseMiddle { get; }
Property Value

Sprite


MouseRight

The mouse with right button pressed.

protected StardewUI.Graphics.Sprite MouseRight { get; }
Property Value

Sprite


Methods

Get(SButton, Boolean)

Gets the sprite corresponding to a particular key.

public StardewUI.Graphics.Sprite Get(StardewModdingAPI.SButton key, out System.Boolean isPlaceholder);
Parameters

key   SButton
The key to retrieve.

isPlaceholder   Boolean
true if the returned Sprite is not specific to the key, but is instead a placeholder (border/background) in which some substitute, typically normal text, must be drawn. false if the Sprite is a complete self-contained representation of the key.

Returns

Sprite


Get(SButton)

Gets the specific sprite for a particular button.

protected virtual StardewUI.Graphics.Sprite Get(StardewModdingAPI.SButton button);
Parameters

button   SButton
The button for which to retrieve a sprite.

Returns

Sprite

The precise Sprite representing the given button, or null if the button does not have a special sprite and could/should use a generic background + text.