Help us shape the future of Go! Take the 2026 Go Developer Survey

anim

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package anim gestiona el tick global de animaciones de la TUI v2 (RF-1/§4.3): un único tea.Tick a ~16 fps que solo existe mientras haya al menos una animación activa. Sin animaciones, no hay ticks (0 % de CPU). Con movimiento reducido, nunca hay ticks.

Index

Constants

View Source
const Interval = 60 * time.Millisecond

Interval es el latido por defecto (≈16 fps).

View Source
const MinInterval = 33 * time.Millisecond

MinInterval es el tope duro de 30 fps.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

Manager es el gestor de animaciones. Es seguro para uso concurrente.

func New

func New(reduced bool) *Manager

New crea un gestor. reduced (movimiento reducido) desactiva las animaciones.

func (*Manager) Active

func (m *Manager) Active() int

Active devuelve cuántas animaciones están activas.

func (*Manager) Interval

func (m *Manager) Interval() time.Duration

Interval devuelve el intervalo de tick actual (nunca por debajo del tope).

func (*Manager) SetReduced

func (m *Manager) SetReduced(v bool)

SetReduced cambia el modo de movimiento reducido.

func (*Manager) Start

func (m *Manager) Start(id string)

Start marca una animación como activa. Reduce los ticks al arrancar.

func (*Manager) Stop

func (m *Manager) Stop(id string)

Stop marca una animación como inactiva.

func (*Manager) Tick

func (m *Manager) Tick() tea.Cmd

Tick devuelve un tea.Cmd que emite TickMsg a intervalos fijos mientras haya animaciones activas; si no hay ninguna (o hay movimiento reducido), devuelve nil y la TUI queda en reposo.

type TickMsg

type TickMsg struct {
	At time.Time
}

TickMsg es el mensaje que emite el gestor en cada latido.

Jump to

Keyboard shortcuts

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