Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sprite package update #69

Open
IsoPhoenix opened this issue Apr 15, 2023 · 0 comments
Open

Sprite package update #69

IsoPhoenix opened this issue Apr 15, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@IsoPhoenix
Copy link
Collaborator

Overview

Our current package for rendering and animating spritesheets, react-responsive-spritesheet, is not state responsive, so we cannot dynamically update a player's appearance (say, upon inventory equips) without refreshing the page. The package itself is actually just a single class component. We could basically rewrite this in function component form and use the locally-written version (say, Spritesheet.tsx) instead of the package.

Checks

We would want to make sure that the rewrite is capable of the following functionality:

  • Rendered sprites in the Shop page should look nice in terms of margins, padding, centering, resizing, etc.
  • Rendered avatars should also look nice and be able to render as static avatars and animated sprites (depending on whether renderStatic() or renderAnimated() is used)
  • We would want the functionality that is already present in react-responsive-spritesheet where a sprite would animate on hover.
  • Previously, because react-responsive-spritesheet didn't work with state, we needed to reload the page in order to see updated avatars when someone customized avatars. In InventoryItemCard.tsx, remove the window.location.reload() and see if sprites can update dynamically as the player customizes them. This is very important! If this doesn't work, we might need to reconsider some of the state handling or class logic in items.tsx and Avatar.tsx.
@IsoPhoenix IsoPhoenix added the bug Something isn't working label Apr 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant