Uses of Class
org.openpatch.scratch.extensions.math.Vector2
Packages that use Vector2
Package
Description
The org.openpatch.scratch package contains classes that provide an API for creating Scratch-like
projects in Java.
-
Uses of Vector2 in org.openpatch.scratch
Methods in org.openpatch.scratch that return Vector2Modifier and TypeMethodDescriptionSprite.getMouse()
Retrieves the current position of the mouse cursor.Stage.getMouse()
Sprite.getPosition()
Retrieves the current position of the sprite.Methods in org.openpatch.scratch with parameters of type Vector2Modifier and TypeMethodDescriptionvoid
Sprite.changePosition
(Vector2 v) Changes the position of the sprite by a given vector.void
Moves the sprite in the direction of the given vector.void
Sprite.pointInDirection
(Vector2 v) Points the sprite in the direction of the given vector.void
Sprite.setDirection
(Vector2 v) Sets the direction of the sprite to the direction of a given vector.void
Sprite.setPosition
(Vector2 v) Sets the position of the sprite based on the coordinates of a given vector. -
Uses of Vector2 in org.openpatch.scratch.extensions.camera
Methods in org.openpatch.scratch.extensions.camera that return Vector2Modifier and TypeMethodDescriptionCamera.getPosition()
Returns the position of the spriteCamera.toGlobalPosition
(Vector2 v) Converts local camera coordinates to screen coordinatesCamera.toLocalPosition
(Vector2 v) Converts screen coordinates to local camera coordinatesMethods in org.openpatch.scratch.extensions.camera with parameters of type Vector2Modifier and TypeMethodDescriptionvoid
Camera.setPosition
(Vector2 v) Sets the position of the sprite based on the coordinates of a given vector.Camera.toGlobalPosition
(Vector2 v) Converts local camera coordinates to screen coordinatesCamera.toLocalPosition
(Vector2 v) Converts screen coordinates to local camera coordinates -
Uses of Vector2 in org.openpatch.scratch.extensions.math
Methods in org.openpatch.scratch.extensions.math that return Vector2Modifier and TypeMethodDescriptionAdds another vector and returns the resultVector2.clone()
Creates a clone of the vectorstatic Vector2
Vector2.fromPolar
(double magnitude, double angle) Constructor method for constructing a vector based on polar coordinates.Vector2.multiply
(double scalar) Multiplies a scalar and return the result.Vector2.normalVector()
Returns the normal vector, which is perpendicular to the vector.static Vector2
Random.randomPosition()
Returns a random position with respect to the width of the window.static Vector2
Random.randomVector2()
Returns a random unit vectorVector2.reverse()
Reverses a vector and returns the result.Vector2.rotateBy
(double angle) Rotates the vector by an angle and returns the result.Vector2.rotateTo
(double angle) Rotates the vector to a given angle and returns the result.Substracts another vector and returns the resultVector2.unitVector()
Returns the unit vector.Methods in org.openpatch.scratch.extensions.math with parameters of type Vector2Modifier and TypeMethodDescriptionAdds another vector and returns the resultdouble
Calculates the distance to another vector.double
Vector2.distanceSq
(Vector2 v) Calculates the squared distance to another vector.double
Calculates the dot product.Substracts another vector and returns the resultConstructors in org.openpatch.scratch.extensions.math with parameters of type Vector2 -
Uses of Vector2 in org.openpatch.scratch.extensions.pen
Methods in org.openpatch.scratch.extensions.pen with parameters of type Vector2Modifier and TypeMethodDescriptionvoid
Pen.setPosition
(Vector2 v) Sets the position of the pen using a Vector2 object. -
Uses of Vector2 in org.openpatch.scratch.extensions.shader
Methods in org.openpatch.scratch.extensions.shader with parameters of type Vector2 -
Uses of Vector2 in org.openpatch.scratch.extensions.text
Methods in org.openpatch.scratch.extensions.text that return Vector2Modifier and TypeMethodDescriptionText.getPosition()
Retrieves the current position as a Vector2 object.Methods in org.openpatch.scratch.extensions.text with parameters of type Vector2Modifier and TypeMethodDescriptionvoid
Text.setPosition
(Vector2 v) Sets the position of the text object using a Vector2 object.