Documentation
¶
Overview ¶
Package easing is a go implementation of Robert Penner's Easing Equations - http://robertpenner.com/easing/
Index ¶
- Constants
- Variables
- func BackIn(p float64) float64
- func BackInOut(p float64) float64
- func BackOut(p float64) float64
- func BounceIn(p float64) float64
- func BounceInOut(p float64) float64
- func BounceOut(p float64) float64
- func Linear(p float64) float64
- func NewCore(termEnv string, options ...Option) (term.Engine, error)
- func QuadIn(p float64) float64
- func SineIn(p float64) float64
- func SineInOut(p float64) float64
- func SineOut(p float64) float64
- func WrapString(s string, lim uint) string
- type EventResize
- type Finalizer
- type Option
Constants ¶
const (
Debug = false // if set to false, the compiler will cleanup/remove the lines inside functions
)
Variables ¶
var ( // ErrNoScreen indicates that no suitable screen could be found. // This may result from attempting to run on a platform where there is no support for either termios or console I/O (such as nacl), or from running in an environment where there is no access to a suitable console/terminal device. // (For example, running on without a controlling TTY or with no /dev/tty on POSIX platforms.) ErrNoScreen = errors.New("no suitable screen available") // ErrNoCharset indicates that the locale environment the program is not supported by the program, because no suitable encoding was found for it. // This problem never occurs if the environment is UTF-8 or UTF-16. ErrNoCharset = errors.New("character set not supported") )
Functions ¶
func BounceInOut ¶
func NewCore ¶
NewCore returns a Engine that uses the stock TTY interface and POSIX termios, combined with a comm description taken from the $TERM environment variable. It returns an error if the terminal is not supported for any reason. For terminals that do not support dynamic resize events, the $LINES $COLUMNS environment variables can be set to the actual window size, otherwise defaults taken from the terminal database are used.
func WrapString ¶
WrapString wraps the given string within lim width in characters.
Wrapping is currently naive and only happens at white-space. A future version of the library will implement smarter wrapping. This means that pathological cases can dramatically reach past the limit, such as a very long word.
Types ¶
type EventResize ¶
type EventResize struct {
// contains filtered or unexported fields
}
EventResize is sent when the window size changes.
type Option ¶
type Option func(core *core)
func WithRunesFallback ¶
WithRunesFallback is a functional option to set a different runes fallback equivalence. See defaultRunesFallback for current defaults.
func WithTrueColor ¶
WithTrueColor is a functional option to disable true color, if needed. Just set the trueColor to "disable".
func WithWinSizeBufferedChannelSize ¶
WithWinSizeBufferedChannelSize is a functional option to set the buffered channel size, used for resize events. Default is the runtime.NumCPU().