react-native-sprite-sheet
v0.0.3
Published
Use sprite sheet to display image and animation.
Downloads
53
Readme
react-native-sprite-sheet
Use sprite sheet to display image and animation.
Usage
Installation
yarn add react-native-sprite-sheet
or
npm i react-native-sprite-sheet
Example
import SpriteImage from 'react-native-sprite-sheet'
const Icon = () => (
<SpriteImage
source={require('./icon.png')}
data={require('./icon.json')}
name='success'
style={{ width: 20, height: 20}}
/>
)
export default Icon
Make Sprite Sheet
Use TexturePacker to package images and output JSON data.
Use scripts to format JSON data.
yarn react-native-sprite-sheet icon.json
or
node_modules/.bin/react-native-sprite-sheet icon.json