keyhint

package module
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2022 License: Apache-2.0 Imports: 7 Imported by: 1

README

keyhint

The keyhint component contains constructors for bordered, colored text icons (hinting that a given key / button will trigger something)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AlignHintToButton

func AlignHintToButton(kh *KeyHint, e *entities.Entity)

AlignHintToButton aligns the keyhint with the given entitry in a normalized location.

Types

type KeyHint

type KeyHint struct {
	Options
	render.Renderable
}

A KeyHint is a small, colored renderable displaying some text. The text is designed to be a key 'A,B,C,D' or controller button 'A,B,X,Y', and intended for use as a hint to imply that pressing that key or button will trigger something.

type Options

type Options struct {
	Key         string
	Color       color.RGBA
	BorderColor color.RGBA
	Font        *render.Font
	Height      int
	// Todo: Fit text
	Rounded bool
}

Options used to generate a keyhint

func (Options) Generate

func (o Options) Generate() *KeyHint

Generate the keyhint from its provided options combined with defaults.

Jump to

Keyboard shortcuts

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