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

Avatar: Update sprite generation package to Pixi #50

Open
IsoPhoenix opened this issue Feb 19, 2023 · 0 comments
Open

Avatar: Update sprite generation package to Pixi #50

IsoPhoenix opened this issue Feb 19, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@IsoPhoenix
Copy link
Collaborator

Avatar: Update sprite generation package to Pixi

Overview:

At the moment, Questable uses a package called react-responsive-spritesheet to navigate spritesheets and render sprites. This package is outdated and doesn't work with modern React state variables. Updating to Pixi, a modern React animation package, will allow for more fluid and responsive sprite animation in avatars and otherwise.

Resources:

Frontend:

  • All sprite rendering logic is abstracted into items.tsx, which contains class definitions for different objects. Rewrite the render() function to use react-pixi instead of react-responsive-spritesheet to render sprites.
  • Remove all references to react-responsive-spritesheet and uninstall with npm uninstall react-responsive-spritesheet
  • Run the following "tests" on the app:
    • 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)
    • 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 enhancement New feature or request label Feb 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants