buttons

package
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 26, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ColourButton

type ColourButton struct {
	// contains filtered or unexported fields
}

ColourButton represents a button which is a solid block of a single colour

func NewColourButton

func NewColourButton(colour color.Color) *ColourButton

NewColourButton creates a new ColourButton of the specified colour

func (*ColourButton) GetButtonIndex

func (btn *ColourButton) GetButtonIndex() int

GetButtonIndex is the interface implemention to get which button on the Streamdeck this is

func (*ColourButton) GetImageForButton

func (btn *ColourButton) GetImageForButton(btnSize int) image.Image

GetImageForButton is the interface implemention to get the button's image as an image.Image

func (*ColourButton) Pressed

func (btn *ColourButton) Pressed()

Pressed is the interface implementation for letting the engine notify that the button has been pressed. This hands-off to the specified ButtonActionHandler if it has been set.

func (*ColourButton) RegisterUpdateHandler

func (btn *ColourButton) RegisterUpdateHandler(f func(streamdeck.Button))

RegisterUpdateHandler is the interface implemention to let the engine give this button a callback to use to request that the button image is updated on the Streamdeck.

func (*ColourButton) SetActionHandler

func (btn *ColourButton) SetActionHandler(a streamdeck.ButtonActionHandler)

SetActionHandler allows a ButtonActionHandler implementation to be set on this button, so that something can happen when the button is pressed.

func (*ColourButton) SetButtonIndex

func (btn *ColourButton) SetButtonIndex(btnIndex int)

SetButtonIndex is the interface implemention to set which button on the Streamdeck this is

func (*ColourButton) SetColour

func (btn *ColourButton) SetColour(colour color.Color)

SetColour allows the colour for the button to be changed on the fly

type ImageFileButton

type ImageFileButton struct {
	// contains filtered or unexported fields
}

ImageFileButton represents a button with an image on it, where the image is loaded from a file.

func NewImageFileButton

func NewImageFileButton(filePath string) (*ImageFileButton, error)

NewImageFileButton creates a new ImageFileButton with the specified image on it

func (*ImageFileButton) GetButtonIndex

func (btn *ImageFileButton) GetButtonIndex() int

GetButtonIndex is the interface implemention to get which button on the Streamdeck this is

func (*ImageFileButton) GetImageForButton

func (btn *ImageFileButton) GetImageForButton(btnSize int) image.Image

GetImageForButton is the interface implemention to get the button's image as an image.Image

func (*ImageFileButton) Pressed

func (btn *ImageFileButton) Pressed()

Pressed is the interface implementation for letting the engine notify that the button has been pressed. This hands-off to the specified ButtonActionHandler if it has been set.

func (*ImageFileButton) RegisterUpdateHandler

func (btn *ImageFileButton) RegisterUpdateHandler(f func(streamdeck.Button))

RegisterUpdateHandler is the interface implemention to let the engine give this button a callback to use to request that the button image is updated on the Streamdeck.

func (*ImageFileButton) SetActionHandler

func (btn *ImageFileButton) SetActionHandler(a streamdeck.ButtonActionHandler)

SetActionHandler allows a ButtonActionHandler implementation to be set on this button, so that something can happen when the button is pressed.

func (*ImageFileButton) SetButtonIndex

func (btn *ImageFileButton) SetButtonIndex(btnIndex int)

SetButtonIndex is the interface implemention to set which button on the Streamdeck this is

func (*ImageFileButton) SetFilePath

func (btn *ImageFileButton) SetFilePath(filePath string) error

SetFilePath allows the image file to be changed on the fly

type TextButton

type TextButton struct {
	// contains filtered or unexported fields
}

TextButton represents a button with text on it

func NewTextButton

func NewTextButton(label string) *TextButton

NewTextButton creates a new TextButton with the specified text on it, in white on a black background. The text will be set on a single line, and auto-sized to fill the button as best as possible.

func NewTextButtonWithColours

func NewTextButtonWithColours(label string, textColour color.Color, backgroundColour color.Color) *TextButton

NewTextButtonWithColours creates a new TextButton with the specified text on it, in the specified text and background colours. The text will be set on a single line, and auto-sized to fill the button as best as possible.

func (*TextButton) GetButtonIndex

func (btn *TextButton) GetButtonIndex() int

GetButtonIndex is the interface implemention to get which button on the Streamdeck this is

func (*TextButton) GetImageForButton

func (btn *TextButton) GetImageForButton(btnSize int) image.Image

GetImageForButton is the interface implemention to get the button's image as an image.Image

func (*TextButton) Pressed

func (btn *TextButton) Pressed()

Pressed is the interface implementation for letting the engine notify that the button has been pressed. This hands-off to the specified ButtonActionHandler if it has been set.

func (*TextButton) RegisterUpdateHandler

func (btn *TextButton) RegisterUpdateHandler(f func(streamdeck.Button))

RegisterUpdateHandler is the interface implemention to let the engine give this button a callback to use to request that the button image is updated on the Streamdeck.

func (*TextButton) SetActionHandler

func (btn *TextButton) SetActionHandler(a streamdeck.ButtonActionHandler)

SetActionHandler allows a ButtonActionHandler implementation to be set on this button, so that something can happen when the button is pressed.

func (*TextButton) SetBackgroundColor

func (btn *TextButton) SetBackgroundColor(backgroundColour color.Color)

SetBackgroundColor allows the background colour on the button to be changed on the fly

func (*TextButton) SetButtonIndex

func (btn *TextButton) SetButtonIndex(btnIndex int)

SetButtonIndex is the interface implemention to set which button on the Streamdeck this is

func (*TextButton) SetText

func (btn *TextButton) SetText(label string)

SetText allows the text on the button to be changed on the fly

func (*TextButton) SetTextColour

func (btn *TextButton) SetTextColour(textColour color.Color)

SetTextColour allows the colour of the text on the button to be changed on the fly

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL