All Projects → jcblw → React Sprite Animator

jcblw / React Sprite Animator

Licence: isc
A React component that animates simple spritesheets

Programming Languages

javascript
184084 projects - #8 most used programming language

Labels

Projects that are alternatives of or similar to React Sprite Animator

BonEngineSharp
A simple and fun SDL-based game engine in C#.
Stars: ✭ 16 (-74.19%)
Mutual labels:  sprites
Free Tex Packer
Free texture packer
Stars: ✭ 337 (+443.55%)
Mutual labels:  sprites
Ancientbeast
Turn Based Strategy Game. Master your beasts! 🐺
Stars: ✭ 907 (+1362.9%)
Mutual labels:  sprites
tuile
Tuile (french for tile) is a 2D graphics engine inspired from old hardware and based on layers, tiles sets, tile maps and sprites. Its scanline rendering pipeline makes it perfect for raster effects.
Stars: ✭ 19 (-69.35%)
Mutual labels:  sprites
Ikonate
Fully customisable & accessible vector icons
Stars: ✭ 3,392 (+5370.97%)
Mutual labels:  sprites
Pokesprite
Database project of box and inventory sprites from the Pokémon core series games
Stars: ✭ 489 (+688.71%)
Mutual labels:  sprites
pixel-art
A minimalist, cross device compatible pixel art editor.
Stars: ✭ 72 (+16.13%)
Mutual labels:  sprites
Phaser Tilemap Plus
Tilemap animations, physics, events and custom property enhancements for Tiled JSON map files
Stars: ✭ 44 (-29.03%)
Mutual labels:  sprites
Spriteworld
Spriteworld: a flexible, configurable python-based reinforcement learning environment
Stars: ✭ 337 (+443.55%)
Mutual labels:  sprites
Pixelvision8
Pixel Vision 8's core philosophy is to teach retro game development with streamlined workflows. PV8 is also a platform that standardizes 8-bit fantasy console limitations built on top of the open-source C# game engine based on MonoGame.
Stars: ✭ 773 (+1146.77%)
Mutual labels:  sprites
SpookyGhost
A procedural sprite animation tool made with the nCine
Stars: ✭ 185 (+198.39%)
Mutual labels:  sprites
Mbtileparser
MBTileParser is a game engine written using pure UIKit in the days before SpriteKit.
Stars: ✭ 297 (+379.03%)
Mutual labels:  sprites
Spritedicing
Unity extension for reusing sprite texture areas
Stars: ✭ 589 (+850%)
Mutual labels:  sprites
dti-sprites
(ICCV 2021) Code for "Unsupervised Layered Image Decomposition into Object Prototypes" paper
Stars: ✭ 33 (-46.77%)
Mutual labels:  sprites
Taro scaffold
基于 Taro / dva / redux-saga / react 的微信小程序脚手架,同时集成了 sprite 。
Stars: ✭ 24 (-61.29%)
Mutual labels:  sprites
SlopeCraft
Get your map pixel art in minecraft
Stars: ✭ 298 (+380.65%)
Mutual labels:  sprites
Postcss Sprites
Generate sprites from stylesheets.
Stars: ✭ 402 (+548.39%)
Mutual labels:  sprites
Ol Games
🎮 Game stuff for Openlayers, powered by HTML5, canvas, javascript and Openlayers.
Stars: ✭ 61 (-1.61%)
Mutual labels:  sprites
Blit
👾 Blitting library for 2D sprites
Stars: ✭ 15 (-75.81%)
Mutual labels:  sprites
Slate
Pixel Art Editor
Stars: ✭ 723 (+1066.13%)
Mutual labels:  sprites

React Sprite Animator

Dependabot

This is a component that animates through an image sprite.

Install

npm i react-sprite-animator -S
# or
yarn add react-sprite-animator

React is used with this library but do not come bundled with this library. Please make sure you have those installed before using.

Usage

You are able to use this library as a component or as a hook.

The component

import { SpriteAnimator } from 'react-sprite-animator'
...
<SpriteAnimator
  sprite="/path-to/sprite.svg"
  width={100}
  height={100}
/>

The hook

import { useSprite } from 'react-sprite-animator'

const MyComponent = () => {
  const styles = useSprite({
    sprite: '/path-to/sprite.svg',
    width: 100,
    height: 100,
  })

  return <div style={style} />
}

Props

This is the same for the hooks options and the props of the component.

  • width {number} - width of clipped sprite (original, non-scaled dimensions)
  • height {number} - height of clipped sprite (original, non-scaled dimensions)
  • scale {number} - scale of the original sprite (default: 1, retina / @2x: 2)
  • sprite {string} - path to sprite
  • direction {string} - horizontal/vertical
  • shouldAnimate {bool} - if the sprite should animate
  • startFrame {number} - the frame to start animation
  • fps {number} - the frame rate (frames per second) target
  • stopLastFrame {bool} - stops animation from looping
  • frame {number} - manually sets current frame
  • onEnd {function} - callback when the animation finishes (only triggered when stopLastFrame is true)

Only required for two-dimensional sprites

  • frameCount {number} - the total frame count of the sprite
  • wrapAfter {number} - the row or column count of the sprite (direction: "horizontal" -> columns, "vertical" -> rows)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].