Overview
Thewatch command monitors input directories for file changes and automatically repacks the atlas whenever sprites are added, modified, or deleted. This is ideal for iterative development workflows.
Basic usage
Examples
Arguments and options
Thewatch command accepts all the same arguments and options as fastpack pack. See the pack reference for complete documentation of available flags.
The watch command shares the exact same configuration options as
pack. The only difference is that watch runs continuously and monitors for file changes.Key options
Input directories or files to watch for changes. When using
--project, this argument is optional.Load settings from a
.fpsheet project file. The watcher monitors both the input directories and the project file itself.Output directory for the generated atlas and data file.
Base name for output files (without extension).
Behavior
File monitoring
The watcher monitors:- All input directories recursively
- The project file (when using
--project) - New files added to watched directories
- Modifications to existing sprite files
- Deletions of sprite files
Automatic repacking
When a change is detected:- The watcher waits briefly for additional changes (debouncing)
- A new pack operation runs with the current settings
- Output files are regenerated
- Statistics are printed to the console
Continuous operation
The watch command runs indefinitely until:- You press Ctrl+C to stop it
- A fatal error occurs (e.g., invalid project file)
Example output
Use cases
Game development
With build tools
Hot reload development
Combine with file system watchers to hot-reload atlases in your development environment:Tips
If you’re using a project file, the watcher will automatically repack when you save changes to the
.fpsheet file itself. This makes it easy to iterate on packing settings.Large sprite sets may take several seconds to repack. The watcher debounces changes to avoid running multiple packs when you save several files at once.
Performance considerations
Watch performance
- The watcher uses efficient file system events, not polling
- Only changed files trigger a full repack
- Memory usage remains constant during watch operation
Repack performance
Packing speed depends on:- Number of sprites (100s = fast, 1000s = moderate)
--pack-modesetting (fast<good<best)- Image sizes and complexity
- Trim and extrude settings
See also
- fastpack pack - One-time packing operation
- fastpack init - Create a project file for watch mode
- Configuration reference - Complete .fpsheet format