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.
Provides classes and interfaces for camera extensions in Scratch.
Provides classes and interfaces for math extensions in Scratch.
Provides classes and interfaces for pen extensions in Scratch.
Provides classes and interfaces for shader extensions in Scratch.
Provides classes and interfaces for text extensions in Scratch.
-
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()Returns the current position of the mouse cursor as a Vector2Sprite.getPosition()Retrieves the current position of the sprite.Methods in org.openpatch.scratch with parameters of type Vector2Modifier and TypeMethodDescriptionvoidSprite.changePosition(Vector2 v) Changes the position of the sprite by a given vector.voidMoves the sprite in the direction of the given vector.voidSprite.pointInDirection(Vector2 v) Points the sprite in the direction of the given vector.voidSprite.setDirection(Vector2 v) Sets the direction of the sprite to the direction of a given vector.voidSprite.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 TypeMethodDescriptionvoidCamera.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 Vector2Vector2.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 Vector2Random.randomPosition()Returns a random position with respect to the width of the window.static Vector2Random.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 resultdoubleCalculates the distance to another vector.doubleVector2.distanceSq(Vector2 v) Calculates the squared distance to another vector.doubleCalculates 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 TypeMethodDescriptionvoidPen.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 TypeMethodDescriptionvoidText.setPosition(Vector2 v) Sets the position of the text object using a Vector2 object.