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

Clean up of sprite helper functions #4775

Merged
merged 5 commits into from
Mar 21, 2018
Merged

Conversation

GoodBoyDigital
Copy link
Member

Cleaned up sprite helper functions.
We only really need one! PIXI.Sprite.from
Added ability to pass texture options
Brings function inline with PIXI.Texture.from
Also you can now pass a texture in to the from function. Handy!

Copy link
Member

@bigtimebuddy bigtimebuddy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love this change 👍 Just a little bit about resolving deprecations. Happy to help with this if you'd like.

Sprite.fromSVG = Sprite.from;
Sprite.fromCanvas = Sprite.from;
Sprite.fromVideo = Sprite.from;
Sprite.fromFrame = Sprite.from;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should definitely deprecate these. Particularly converting fromImage and fromSVG function signatures to match from(source, options). @GoodBoyDigital, do you want me to take care of the deprecations in this PR?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets bury the stewardess

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @bigtimebuddy if you could that would be great! I think they also exist like that in the Texture class too.

@bigtimebuddy
Copy link
Member

@GoodBoyDigital could you take a look at this?

Deprecated

  • PIXI.Sprite.fromImage moves to PIXI.Sprite.from
  • PIXI.Sprite.fromSVG moves to PIXI.Sprite.from
  • PIXI.Sprite.fromCanvas moves to PIXI.Sprite.from
  • PIXI.Sprite.fromVideo moves to PIXI.Sprite.from
  • PIXI.Sprite.fromFrame moves to PIXI.Sprite.from
  • PIXI.Texture.fromImage moves to PIXI.Texture.from
  • PIXI.Texture.fromSVG moves to PIXI.Texture.from
  • PIXI.Texture.fromCanvas moves to PIXI.Texture.from
  • PIXI.Texture.fromVideo moves to PIXI.Texture.from
  • PIXI.Texture.fromFrame moves to PIXI.Texture.from

@bigtimebuddy bigtimebuddy merged commit 7dc879c into next Mar 21, 2018
@bigtimebuddy bigtimebuddy deleted the feature/sprite-from-cleanup branch March 21, 2018 15:16
@bigtimebuddy bigtimebuddy mentioned this pull request Apr 5, 2018
@lock
Copy link

lock bot commented Mar 21, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants