Documente Academic
Documente Profesional
Documente Cultură
=================
--- Functions ---
=================
-- Mathematical Functions --
============================
int Floor(float x)
* Truncates x to an integer
int Ceiling(float x)
* Raises x to the nearest integer
int Round(float x)
* Rounds x to the nearest integer
float Randf(float n)
* Returns a random floating point number up to n
float DegtoRad(float d)
* Converts 'd' in degrees to radians
float RadtoDeg(float r)
* Converts 'r' in radians to degrees
int Sign(int n)
* Returns the sign of n
float TurnTowards( int X, int Y, int targetX, int targetY, float radian_angle,
float t )
* Returns an angle pointing (t)percentage more accurate to the target than the
specified radian_angle.
-- Direction Functions --
=========================
* Make sure your angles are in the range -PI to PI (with WrapAngle) before using
these functions
-- Drawing Functions --
=======================
void DrawString(int layer, int x, int y, int font, int color, int background_color,
int format, int opacity,
int string, int start)
* Overload to Screen->DrawString which includes a position to start drawing from
in the string
* Does not check for overflow
void DrawString(int layer, int x, int y, int font, int color, int background_color,
int format, int opacity,
int string, int start, int end)
* Overload to Screen->DrawString which includes a start and end position to draw
the string
* Does not check for overflow
-- Conditional Functions --
===========================
T Cond(bool cond, T a, T b)
* Returns a if cond is true, else b. Overloaded to take all types as arguments
bool RectCollision(int box1_x1, int box1_y1, int box1_x2, int box1_y2, int box2_x1,
int box2_y1, int box2_x2, int box2_y2)
* Generalized and optimized rectangle collision checking function.
* Returns true if the bounding box of box1 and box2 overlap.
bool SquareCollision(int c1x, int c1y, int side1, int c2x, int c2y, int side2)
* Check for collisions of two squares given upper-left coordinates and a side
length for each.
bool SquareCollision2(int c1x, int c1y, int radius1, int c2x, int c2y, int radius2)
* Check for collisions of two squares given center coordinates and a halved side
length for each.
bool CircleCollision(int c1x, int c1y, int radius1, int c2x, int c2y, int radius2)
* Returns true if the two circles c1 and c2 overlap.
bool Collision(T a, S b)
* Returns true if there is a collision between the hitboxes of any two pointers
void SetScreenDBit(int dmap, int screen, int d, int bit, bool state)
void SetScreenDBit(int screen, int d, int bit, bool state)
void SetScreenDBit(int d, int bit, bool state)
* Sets bit 'bit' of Screen->D[] register 'd' to 'state', overloaded to set on
other screens
bool InputLeftClick()
* Returns true if the left mouse button is pressed
bool InputRightClick()
* Returns true if the right mouse button is pressed
int GetEquipmentA()
* Returns the item ID of the item equipped to Link's A button
int GetEquipmentB()
* Returns the item ID of the item equipped to Link's B button
*weapon Duplicate(*weapon a)
* Creates and returns an exact copy of the passed weapon. Assumes that the passed
pointer is valid.
void Remove(T n)
* Removes sprite 'n' from the screen. Overloaded.
-- Position Functions --
========================
int GridX(int x)
* Snaps 'x' to the combo grid
* Equivalent to calling ComboX(ComboAt(x, foo));
int GridY(int y)
* Snaps 'y' to the combo grid
* Equivalent to calling ComboY(ComboAt(foo, y));
-- Combo Functions --
=====================
-- Tile Functions --
====================
-- Miscellaneous Functions --
=============================
void Waitframes(int n)
* Wait for 'n' frames
void NoAction()
* Kills all of Link's inputs
void WaitNoAction()
void WaitNoAction(int frames)
* NoAction, then Waitframe or (equivalent of) Waitframes
int FFCNum(ffc f)
* Returns the number of an FFC, and -1 for a non-valid FFC (which should never
happen)
int NumTriforcePieces()
* Returns the number of Triforce Pieces Link currently has
itemdata GetItemData(item i)
* Returns an itemdata pointer from an item pointer
bool IsSideview()
* Returns true if Link is on a sideview screen