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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add static Lerp method on Vector2 #5858

Merged
merged 2 commits into from
Nov 4, 2021

Conversation

GregDevProjects
Copy link
Contributor

@GregDevProjects GregDevProjects commented Oct 7, 2021

Please do not update the README or Change Log, we will do this when we merge your PR.

This PR (delete as applicable)

  • Adds a new feature

Describe the changes below:

Adds a static method to the Vector2 class so that two vectors can be lerped (if that's a word 馃槢 ) without modifying the original Vectors.

Resolves #5684.

@samme
Copy link
Contributor

samme commented Oct 9, 2021

Since Vector2 has no static methods maybe the new method could go on Phaser.Math instead, like Phaser.Math.RandomXY()?

@GregDevProjects
Copy link
Contributor Author

@samme sounds good, there's a Linear static method on the Math class that does the same thing with a Number, so I named this function LinearXY - the XY is intended to specify that a Vector2 will be returned.

Any chance you'd be willing to add the hacktoberfest-accepted label to this PR? 馃槄

@photonstorm photonstorm merged commit 70253a9 into phaserjs:master Nov 4, 2021
@photonstorm
Copy link
Collaborator

馃憤

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add static method for lerp on a Vector
3 participants