Giter Site home page Giter Site logo

danilosetra / react-responsive-spritesheet Goto Github PK

View Code? Open in Web Editor NEW
93.0 3.0 18.0 722 KB

React component which helps you to easily apply responsive spritesheet animations on your project.

License: MIT License

JavaScript 87.06% Shell 12.94%
responsive react spritesheet animation animations npm

react-responsive-spritesheet's Issues

Branch for images

On README.md, change the folder of images from 'develop' to 'master'

Mouse events

The component doesn't supports mouse events besides onclick

Preload

implement functions to allow preload (using promises, for example) of sprite and background images

instance return for events

Return 'instance' for events (like onMouseEnter, onClick, etc) equals getInstance returns. This will allow to manipulate instance without set getInstance component parameter

Event handlers

Implement event handlers

  • onInit
  • onResize
  • onPlay
  • onPause
  • onLoopComplete
  • onEachFrame
  • onFrame

setSpeed function

implement setSpeed function. At this point, the spritesheet can change fps even after starts

Support for ES5

Currently the build version contains class which is not compatible with ES5. It would be nice if the build version was compatible with ES5 so it can be used in IE10/11.

Max Height

component render exceeding determined height when resize window width

Optional parameters

The component can return the following parameters

  • fps
  • steps
  • width
  • height
  • scale

Minified

The build is'nt and must be minified

Add onError callback instead of throwing error

Hi,
The React img component has an onError callback in case there's something wrong with image src.
Would it be possible to provide the same callback in the Spritesheet component?
Currently, Spritesheet throw an error:

 imgLoadSprite.onerror = () => {
      throw new Error(`Failed to load image ${imgLoadSprite.src}`);
 };

could be replaced by:

 imgLoadSprite.onerror = () => {
      onError(`Failed to load image ${imgLoadSprite.src}`);
 };

Regards

Error when unmounting before loading is done

If you unmount the Spritesheet before the loading is done, an error is thrown.

selection_188

You probably have to check whether the component is still mounted if the onload callback.

EDIT: this line is probably returning null since it has already been unmounted.

startAt and endAt

Include startAt and endAt parameters to allow initial and final frames for animation

parameter info while timeout

The parameter 'isPlaying' supplied by getInfo is returning "true" even while spritesheet paused on start, according the timeout was configured. The correct is start with "false", and after timeout completes, return "true", cause till this, its paused, obviously.

change fps, start frame, end frame dynamically

I need to change dynamically sprites on an element, including FPS.
SetFPS function does not work
I understand that the values are initialized when the component is mounted and I can’t change them dynamically, how best to implement this? I can change the start and end frames, but I can’t change the FPS

Multi-row

The component doesn't support multi-row spritesheet images

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.