Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GameKeyMap ¶
type GameKeyMap struct { ForceQuit key.Binding Exit key.Binding Help key.Binding Left key.Binding Right key.Binding Clockwise key.Binding CounterClockwise key.Binding SoftDrop key.Binding HardDrop key.Binding Hold key.Binding }
func ConstructGameKeyMap ¶
func ConstructGameKeyMap(keys *config.Keys) *GameKeyMap
func (*GameKeyMap) FullHelp ¶
func (k *GameKeyMap) FullHelp() [][]key.Binding
func (*GameKeyMap) ShortHelp ¶
func (k *GameKeyMap) ShortHelp() []key.Binding
type GameStyles ¶
type GameStyles struct { Playfield lipgloss.Style EmptyCell lipgloss.Style TetriminoCellStyles map[byte]lipgloss.Style GhostCell lipgloss.Style Hold holdStyles Information lipgloss.Style RowIndicator lipgloss.Style Bag lipgloss.Style CellChar cellCharacters }
func CreateGameStyles ¶
func CreateGameStyles(theme *config.Theme) *GameStyles
type HPickerModel ¶
type HPickerModel struct {
// contains filtered or unexported fields
}
HPickerModel is the model for the horizontal picker component.
func NewHPickerModel ¶
func NewHPickerModel(options []KeyValuePair, opts ...Option) *HPickerModel
func (*HPickerModel) GetSelection ¶
func (m *HPickerModel) GetSelection() KeyValuePair
func (*HPickerModel) Init ¶
func (m *HPickerModel) Init() tea.Cmd
func (*HPickerModel) Next ¶
func (m *HPickerModel) Next()
Next is a helper function for navigating one option forward. It will not go beyond the last option (i.e. len(options) - 1).
func (*HPickerModel) Prev ¶
func (m *HPickerModel) Prev()
Prev is a helper function for navigating one option backward. It will not go page beyond the first option (i.e. option 0).
func (*HPickerModel) Update ¶
Update is the Tea update function which binds keystrokes to pagination.
func (*HPickerModel) View ¶
func (m *HPickerModel) View() string
View renders the cursor to a string.
type KeyValuePair ¶
type Option ¶
type Option func(*HPickerModel)
type TextInputModel ¶
func NewTextInputModel ¶
func NewTextInputModel(placeholder string, width int, charLimit int) TextInputModel
func (TextInputModel) Init ¶
func (m TextInputModel) Init() tea.Cmd
func (TextInputModel) View ¶
func (m TextInputModel) View() string
Click to show internal directories.
Click to hide internal directories.