Game (functions)/Direction

From PMDOWiki
Revision as of 21:09, 17 January 2026 by Imbion (talk | contribs) (Created page with "== GAME:VectorToDirection(RogueElements.Loc) == Turns a vector (preferably a unit vector) into a cardinal or diagonal direction. === Arguments === * <code>v</code>: The vector. === Returns === The direction as one of 8 values. == GAME:VectorToDirection(System.Double,System.Double) == Convenience function to get a vector's components from lua numbers(doubles) === Arguments === * <code>X</code>: The X value of the vector * <code>Y</code>: The Y value of the ve...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

GAME:VectorToDirection(RogueElements.Loc)

Turns a vector (preferably a unit vector) into a cardinal or diagonal direction.


Arguments

  • v: The vector.

Returns

The direction as one of 8 values.

GAME:VectorToDirection(System.Double,System.Double)

Convenience function to get a vector's components from lua numbers(doubles)


Arguments

  • X: The X value of the vector
  • Y: The Y value of the vector

Returns

The direction the vector points to as one of 8 values.

GAME:RandomDirection

Generates a random direction.


Returns

An 8-directional direction.

GAME:SetupLuaFunctions(RogueEssence.Script.LuaEngine)

Setups any extra functionalities for this object written on the lua side.