sparkle-engine
sparkle-engine
Vector2
Class Vector2
2Dåé
Implements
IPoolable
ICopyable
<
Vector2
>
Index
Constructors
constructor
Properties
x
y
Accessors
direction
magnitude
Methods
add
clone
copy
cross
div
dot
mul
normal
pool
Reset
scale
set
sub
unit
from
Angle
lerp
Constructors
constructor
new
Vector2
(
x
,
y
?
)
:
Vector2
Parameters
x
:
number
y
:
number
= x
Returns
Vector2
Properties
x
x
:
number
= 0
y
y
:
number
= 0
Accessors
direction
get
direction
(
)
:
number
Returns
number
set
direction
(
value
)
:
void
Parameters
value
:
number
Returns
void
magnitude
get
magnitude
(
)
:
number
Returns
number
set
magnitude
(
value
)
:
void
Parameters
value
:
number
Returns
void
Methods
add
add
(
v
,
create
?
)
:
Vector2
Parameters
v
:
Vector2
create
:
boolean
= false
Returns
Vector2
clone
clone
(
)
:
Vector2
Returns
Vector2
copy
copy
(
obj
)
:
void
Parameters
obj
:
Vector2
Returns
void
cross
cross
(
v
)
:
number
Parameters
v
:
Vector2
Returns
number
div
div
(
scalar
,
create
?
)
:
Vector2
Parameters
scalar
:
number
create
:
boolean
= false
Returns
Vector2
dot
dot
(
v
)
:
number
Parameters
v
:
Vector2
Returns
number
mul
mul
(
scalar
,
create
?
)
:
Vector2
Parameters
scalar
:
number
create
:
boolean
= false
Returns
Vector2
normal
normal
(
create
?
)
:
Vector2
Parameters
create
:
boolean
= false
Returns
Vector2
pool
Reset
pool
Reset
(
x
,
y
?
)
:
void
Parameters
x
:
number
y
:
number
= x
Returns
void
scale
scale
(
scalar
,
create
?
)
:
Vector2
Parameters
scalar
:
number
create
:
boolean
= false
Returns
Vector2
set
set
(
x
,
y
?
)
:
Vector2
Parameters
x
:
number
y
:
number
= x
Returns
Vector2
sub
sub
(
v
,
create
?
)
:
Vector2
Parameters
v
:
Vector2
create
:
boolean
= false
Returns
Vector2
unit
unit
(
create
?
)
:
Vector2
Parameters
create
:
boolean
= false
Returns
Vector2
Static
from
Angle
from
Angle
(
angle
)
:
Vector2
Parameters
angle
:
number
Returns
Vector2
Static
lerp
lerp
(
v1
,
v2
,
t
)
:
Vector2
Parameters
v1
:
Vector2
v2
:
Vector2
t
:
number
Returns
Vector2
Preparing search index...
The search index is not available
sparkle-engine
CONTENTS
Math
Color
MathUtils
Matrix
Path
Rect
Vector2
GameNode
Collision
Container
Drawable
Graphical
Sprite
Text
Timer
Transform2D
Texture
AltasTexture
BaseTexture
Texture
TextureManager
Input
InputManager
MouseManager
Physics
Collision
PhysicsManager
Audio
Audio
AudioManager
Others
DebuggerDrawType
GraphicalType
PRIMITIVE_MODE
ResourcesType
SCALE_MODE
TextAnchor
Animations
DataResources
EventEmitter
GLShader
Loader
ObjectPool
Renderer
Resources
ResourcesManager
Scene
SparkleEngine
TextManager
VertexArrayBuffer
AnimationsStore
AttributeInfo
IAnimationFrames
IAnimationOption
IAudioEvent
IBaseGraphicalOptions
ICircleOptions
ICollisionEvent
ICollisionOptions
ICollisionResult
ICompositorOptions
IContainerEvent
IContainerOptions
ICopyable
IDebuggerDraw
IDestoryable
IDrawLineOptions
IDrawOptions
IDrawPolygonOptions
IDrawableOptions
IEventAble
IInputEvents
IListened
ILoadAnimationOptions
ILoaderEvent
IMouseData
IMouseEvents
IPolygonOptions
IPoolable
IRectOptions
IRenderOptions
IResources
IResourcesManagerEvent
IResourcesStore
ISparkleEngineOption
ISpriteOptions
ITextOptions
ITimerEvents
ITimerOptions
ITransform2DOptions
PoolTypes
AttributesLocation
Constructor
IGraphicalOptions
Images
2Dåé