Skip to content

Sprite Compiler Installation

This guide walks you through installing the PixelRoot32 Sprite Compiler on your system.

Prerequisites

Required Software

  • Node.js: Version 14.0 or higher
  • npm: Usually included with Node.js
  • Git: For cloning from source (optional)

Verify Prerequisites

Check if Node.js is installed:

node --version
# Should show v14.0.0 or higher

Check if npm is installed:

npm --version
# Should show version number

If not installed, download from nodejs.org

Installation Methods

The easiest way to install the Sprite Compiler is via npm:

npm install -g pr32-sprite-compiler

This installs the compiler globally, making it available from any directory.

Verify installation:

pr32-sprite-compiler --version

Method 2: From Source

If you want the latest development version or need to customize:

Step 1: Clone Repository

git clone https://github.com/Gperez88/pr32-sprite-compiler.git
cd pr32-sprite-compiler

Step 2: Install Dependencies

npm install

Step 3: Install Locally (Optional)

To use the compiler from anywhere:

npm link

This creates a global symlink to the local installation.

Step 4: Verify Installation

pr32-sprite-compiler --version

Method 3: Local Project Installation

For project-specific installation (not global):

cd your-pixelroot32-project
npm install pr32-sprite-compiler --save-dev

Then use via npx:

npx pr32-sprite-compiler input.png output.h

Platform-Specific Instructions

Windows

  1. Install Node.js from nodejs.org
  2. Download the Windows installer
  3. Run the installer
  4. Restart your terminal/command prompt

  5. Open Command Prompt or PowerShell

  6. Install globally:

    npm install -g pr32-sprite-compiler
    

  7. Verify:

    pr32-sprite-compiler --version
    

Troubleshooting Windows Issues

"pr32-sprite-compiler is not recognized": - Ensure Node.js is in your PATH - Restart terminal after installation - Try using full path: C:\Users\YourName\AppData\Roaming\npm\pr32-sprite-compiler.cmd

Permission errors: - Run terminal as Administrator - Or install locally: npm install pr32-sprite-compiler (without -g)

Linux

Using npm

  1. Install Node.js (if not already installed):

Ubuntu/Debian:

curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install -y nodejs

Fedora/RHEL:

sudo dnf install nodejs npm

  1. Install Sprite Compiler:

    sudo npm install -g pr32-sprite-compiler
    

  2. Verify:

    pr32-sprite-compiler --version
    

Troubleshooting Linux Issues

Permission denied: - Use sudo for global installation - Or install locally without -g flag

Command not found: - Check npm global bin path: npm config get prefix - Add to PATH if needed: export PATH=$PATH:$(npm config get prefix)/bin

macOS

Using npm

  1. Install Node.js:
  2. Download from nodejs.org
  3. Or use Homebrew: brew install node

  4. Install Sprite Compiler:

    npm install -g pr32-sprite-compiler
    

  5. Verify:

    pr32-sprite-compiler --version
    

Using Homebrew (Alternative)

If available as a Homebrew formula:

brew install pr32-sprite-compiler

GUI Version Installation

If a GUI version is available:

Windows

Download the installer from the releases page and run it.

Linux

# Download AppImage or .deb package
# Make executable and run
chmod +x pr32-sprite-compiler-gui.AppImage
./pr32-sprite-compiler-gui.AppImage

macOS

Download the .dmg file from releases and install.

Verification

After installation, verify everything works:

Test Basic Functionality

  1. Create a test image:
  2. Create an 8x8 pixel PNG image (black and white)
  3. Save as test.png

  4. Run compiler:

    pr32-sprite-compiler test.png test_output.h
    

  5. Check output:

  6. File test_output.h should be created
  7. Should contain sprite data arrays

Check Version

pr32-sprite-compiler --version

Check Help

pr32-sprite-compiler --help

Updating

Update via npm

npm update -g pr32-sprite-compiler

Update from Source

cd pr32-sprite-compiler
git pull
npm install

Uninstallation

Remove Global Installation

npm uninstall -g pr32-sprite-compiler

Remove Local Installation

npm uninstall pr32-sprite-compiler

Troubleshooting

Common Issues

"Command not found" after installation: - Restart your terminal - Check npm global bin path: npm config get prefix - Verify PATH includes npm bin directory

Permission errors: - On Linux/macOS: Use sudo for global install - Or install locally without -g flag - On Windows: Run terminal as Administrator

Module not found errors: - Reinstall: npm install -g pr32-sprite-compiler - Clear npm cache: npm cache clean --force

Version conflicts: - Check Node.js version: node --version - Update Node.js if version is too old - Use nvm (Node Version Manager) to manage versions

Getting Help

Next Steps

Once installed, proceed to: - Usage Guide - Learn how to use the compiler - Advanced Features - Explore advanced options

See Also