npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

@darrench3140/react-native-sprite-sheet

v1.1.0

Published

An up to date react native sprite sheet for use in animations.

Readme

react-native-sprite-sheet

An up to date sprite sheet library for React Native. Compatible with Expo.

demo

Why

Sprite Animations are animation clips that are created for 2D assets. There are various ways to create Sprite Animations. One way is to create them from a Sprite Sheet, a collection of Sprites arranged in a grid. The Sprites are then compiled into an Animation Clip that will play each Sprite in order to create the animation, much like a flipbook.

By using a sprite sheet, the number of image files that need to be loaded is greatly reduced, which can result in faster loading times. In addition to performance and memory benefits, using a sprite sheet can also make it easier to organize and manage the assets of a game. When a game has multiple image files, it can be difficult to keep track of which image files are used where in the game. By using a sprite sheet, all of the sprites for a particular game are stored in a single file, which makes it easier to manage and organize the assets of the game.

Installation

npm install @darrench3140/react-native-sprite-sheet

Usage

For detailed usage of the component, please check below links:

Animated Sprite Usage

Sprite Usage

Quick Example

For detailed usage of the components, please check above section. For a quick usage of the AnimatedSprite Component, feel free to see below example.

Example input spritesheet

image

Image Property:

Image size: 2816 x 1280

Size of each frame: 128 x 128

Animations:

  • idle: Frames 0 to 8 (9 frames)
  • walk: Frames 9 to 16 (8 frames)
  • run: Frames 17 to 24 (8 frames)
  • attack1: Frames 25 to 29 (5 frames)
  • attack2: Frames 30 to 34 (5 frames)
  • attack3: Frames 35 to 40 (6 frames)
  • shot: Frames 41 to 54 (14 frames)
  • jump: Frames 55 to 63 (9 frames)
  • hurt: Frames 64 to 66 (3 frames)
  • dead: Frames 67 to 71 (5 frames)

Component:

import { AnimatedSprite, getFrames, type AnimatedSpriteType } from '@darrench3140/react-native-sprite-sheet'

const Component = () => {
    const animatedRef = useRef<AnimatedSpriteType>(null)

    // ...

    return (
        <AnimatedSprite
            ref={animatedRef}
            source={require('../assets/spritesheet/samurai/Samurai_Archer_Spritelist.psd')}
            spriteSheetSize={{ width: 2816, height: 1280 }}
            size={{ width: 200, height: 200 }}
            columnRowMapping={[9, 8, 8, 5, 5, 6, 14, 9, 3, 5]}
            frameSize={{ width: 128, height: 128 }}
            defaultAnimationName="idle"
            animations={{
                idle: getFrames(0, 8),
                walk: getFrames(9, 16),
                run: getFrames(17, 24),
                attack1: getFrames(25, 29),
                attack2: getFrames(30, 34),
                attack3: getFrames(35, 40),
                shot: getFrames(41, 54),
                jump: [...getFrames(55, 63), 0],
                hurt: getFrames(64, 66),
                dead: getFrames(67, 71),
            }}
        />
    )
}

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library

Acknowledgements 🙌

This project is inspired by the following projects and tools. Great thanks to the creators!

Credit: