Skip to content

Documentation

This documentation is designed for quick reference

Version: 0.3


Window.cs (class)

public static Point GetMonitorSize() // Get display or monitor size
public static string GetMonitorName() // Get display or monitor name
public static void SetIcon(string path) // Set window icon from file
public static void SetTitle(string title) // Set window title
public static string GetTitle() // Get window fullscreen
public static void SetFullscreen(bool enabled) // Set window fullscreen
public static bool GetFullscreen() // Get window fullscreen
public static void SetResizable(bool enabled) // Set window resizable
public static bool GetResizable() // Get window resizable
public static void SetBorderless(bool enabled) // Set window borderless
public static bool GetBorderless() // Get window borderless
public static void SetMaximized(bool enabled) // Set window maximized
public static bool GetMaximized() // Get window maximized
public static void SetMinimized(bool enabled) // Set window minimized
public static bool GetMinimized() // Get window minimized
public static void SetPosition(Point position) // Set window position
public static Point GetWindowPosition() // Get window position
public static void SetSize(Point size) // Set window size
public static Point GetSize() // Get window size
public static void SetWidth(int width) // Set window width
public static int GetWidth() // Get window width
public static void SetHeight(int height) // Set window height
public static int GetHeight() // Get window height
public static void SetMaximumSize(Point size) // Set window maximum size
public static Point GetMaximumSize() // Get window maximum size
public static void SetMinimumSize(Point size) // Set window minimum size
public static Point GetMinimumSize() // Get window minimum size
public static void SetVSync(bool enabled) // Set window vsync
public static bool GetVSync() // Get window vsync
public static void Minimize() // Minimize window
public static void Maximize() // Maximize window
public static void Restore() // Restore window
public static void Raise() // Raise window
public static void Show() // Show window
public static void Hide() // Hide window

Graphics.cs (class)

public static void SetResolution(Point size) // Set graphical resolution (set resolution with letterbox)
public static Point GetResolution() // Get graphical resolution
public static void SetScale(Point size) // Set graphical scale
public static Point GetScale() // Get graphical scale
public static void DrawRectangle(Rect rect, Color color) // Draw rectangle with rect and color
public static void DrawCircle(Point center, float radius, Color color) // Draw circle with center, radius and color
public static void DrawEllipse(Point center, float radiusX, float radiusY, Color color) // Draw ellipse with center, radius x, radius y and color
public static void DrawTriangle(Point a, Point b, Point c, Color color) // Draw triangle with a, b, c and color
public static void DrawPoly(Point center, float radius, Color color, int sides) // Draw poly with center, radius, color and sides
public static void DrawLine(Point a, Point b, float thickness, Color color) // Draw line with a, b, thickness and color
public static void DrawPixel(Point point, Color color) // Draw pixel with point and color
public static void DrawGeometry(Texture texture, float[] positions, Color[] colors, float[] uvs, int[] indices) // Draw geometry with texture
public static void DrawGeometry(float[] positions, Color[] colors, int[] indices) // Draw geometry without texture
public static void DrawTexture(Texture texture, Rect uv, Rect position) // Draw section of texture at position
public static void DrawTexture(Texture texture, Rect position) // Draw full texture at position
public static void DrawText(Font font, string text, int x, int y, float size, Color color) // Draw text with a font, position, size and color
public static void DrawDebugText(string text, int x, int y, Color color) // Draw debug text (doesn't require a font)
public static void DrawFps(int x, int y, Color color) // Draw the frame rate
public static void DrawClearColor(Color color) // Draw clear Color
public static void DrawClear() // Draw clear
public static void DrawBegin(Color color) // Draw begin (draw after this call)
public static void DrawEnd() // Draw end (stop drawing after this call)

Texture.cs (class)

public static Texture CreateTexture(string path) // Create new texture instance from file
public static void DestroyTexture(Texture texture) // Destroy existing texture instance
public static void SetPixel(Texture texture, int x, int y, Color color) // Set texture pixel color
public static Color GetPixel(Texture texture, int x, int y) // Get texture pixel color
public static void SetPixels(Texture texture, Color[] pixels) // Set all texture pixel colors
public static Color[] GetPixels(Texture texture) // Get all texture pixel colors
public static void Apply(Texture texture) // Update all texture pixels
public static void Apply(Texture texture, Rect rect) // Update section of texture pixels
public static string GetFormat(Texture texture) // Get texture format (Ex: RGBA32)
public static Point GetSize(Texture texture) // Get texture size
public static int GetWidth(Texture texture) // Get texture width
public static int GetHeight(Texture texture) // Get texture height

Font.cs (class)

public static Font CreateFont(string path) // Create new font instance from file
public static void DestroyFont(Font font) // Destroy existing font instance
public static void SetSpacing(Font font, int spacing) // Set font character spacing
public static int GetSpacing(Font font) // Get font character spacing
public static int GetAscent(Font font) // Get font ascent
public static int GetDescent(Font font) // Get font descent
public static int GetHeight(Font font) // Get font height

Keyboard.cs (class)

public static bool GetButton(Key button) // Get keyboard button pressed
public static bool GetButtonUp(Key button) // Get keyboard button released
public static bool GetButtonDown(Key button) // Get keyboard button down (single frame)

Mouse.cs (class)

public static bool GetButton(int index) // Get mouse button pressed
public static bool GetButtonUp(int index) // Get mouse button released
public static bool GetButtonDown(int index) // Get mouse button down (single frame)
public static Point GetPositonDelta() // Get mouse positon delta
public static Point GetScrollDelta() // Get mouse scroll delta
public static Point GetPositon() // Get mouse positon
public static void ShowCursor() // Show mouse
public static void HideCursor() // Hide mouse

Gamepad.cs (class)

public static bool GetButton(int index, Button button) // Get gamepad button pressed
public static bool GetButtonUp(int index, Button button) // Get gamepad button released
public static bool GetButtonDown(int index, Button button) // Get gamepad button down (single frame)
public static float GetAxis(int index, Axis axis) // Get gamepad axis
public static void SetDeadZone(int index, float deadZone) // Set gamepad dead zone
public static float GetDeadZone(int index) // Get gamepad dead zone
public static void Rumble(int index, float strength, float ms) // Rumble gamepad for ms

Touch.cs (class)

public static bool GetTouch(int index) // Get touch pressed
public static bool GetTouchUp(int index) // Get touch released
public static bool GetTouchDown(int index) // Get touch down (single frame)
public static Point GetTouchPositionDelta(int index) // Get touch position delta
public static Point GetTouchPosition(int index) // Get touch position
public static float GetTouchPressure(int index) // Get touch pressure
public static int GetTouchCount() // Get touch count

TouchKeyboard.cs (class)

public static void Open() // Open screen keyboard
public static void Close() // Close screen keyboard
public static bool IsVisible() // Is screen keyboard visible
public static bool IsSupported() // Is screen keyboard supported
public static string GetText() // Get screen keyboard text

Clipboard.cs (class)

public static void SetClipboardText(string text) // 
public static string GetClipboardText() // Get clipboard text

Audio.cs (class)

public static Audio CreateAudio(string path) // Create new audio instance from file
public static void DestroyAudio(Audio audio) // Destroy existing audio instance
public static void SetMasterVolume(float volume) // Set master audio volume
public static float GetMasterVolume() // Get master audio volume
public static void SetPlaybackPosition(Audio audio, long ms) // Set audio playback position
public static long GetPlaybackPosition(Audio audio) // Get audio playback position
public static void SetVolume(Audio audio, float volume) // Set audio volume
public static float GetVolume(Audio audio) // Get audio volume
public static void SetPitch(Audio audio, float pitch) // Set audio pitch
public static float GetPitch(Audio audio) // Get audio pitch
public static void SetPan(Audio audio, float pan) // Set audio pan position (0 left, 0.5 center, 1 right)
public static float GetPan(Audio audio) // Get audio pan position
public static void SetLoop(Audio audio, bool loop) // Set audio looping
public static bool GetLoop(Audio audio) // Get audio looping
public static long GetRemainingTime(Audio audio) // Get audio remaining time in ms 
public static long GetDurationTime(Audio audio) // Get audio duration time in ms
public static bool IsPlaying(Audio audio) // Is audio playing
public static void Play(Audio audio) // Play audio
public static void Pause(Audio audio) // Pause audio
public static void Resume(Audio audio) // Resume audio
public static void Stop(Audio audio) // Stop audio

Storage.cs (class)

public static string GetCurrentDirectory() // Get current directory
public static bool SetCurrentDirectory(string path) // Set current directory
public static string GetBaseDirectory() // Get base directory
public static bool FileExists(string path) // Does file exist at path
public static bool FileWrite(string path, byte[] bytes) // Write bytes to a file
public static byte[] FileRead(string path) // Read bytes from a file
public static bool FileCreate(string path) // Create file
public static bool FileDelete(string path) // Delete file
public static bool FileCopy(string source, string destination, bool overwrite = false) // Copy file
public static bool FileMove(string source, string destination, bool overwrite = false) // Move file
public static bool FolderExists(string path) // Does folder exist
public static bool FolderCreate(string path) // Create folder
public static bool FolderDelete(string path) // Delete folder (empty folders only)
public static string[] GetFiles(string path) // Get all file paths in directory

Misc.cs (class)

public static void OpenURL(string url) // Open a url in browser
public static void TakeScreenshot() // Take a screenshot and save as png (screenshot_yyyy-mm-dd-hh-mm-ss)

Time.cs (class)

public static int GetFrameCount() // Get frame count
public static float GetFrameTime() // Get frame time in ms
public static float GetDeltaTime() // Get delta time
public static float GetTimeSinceStartup() // Get time since startup
public static void SetFps(int fps) // Set target frame rate
public static float GetFps() // Get target frame rate

Debug.cs (class)

public static void Log(object message, bool trace = false) // Log a message
public static void Warning(object message, bool trace = false) // Log a warning
public static void Error(object message, bool trace = false) // Log an error
public static void Assert(bool condition, object message) // Throw exception if condition is false
public static void Exception(object message) // Throw exception

Maths.cs (class)

public static float Pi() // PI value
public static float TwoPi() // 2 PI value
public static float HalfPi() // Half of PI value
public static float Deg2Rad() // Degrees to radians value
public static float Rad2Deg() // Radians to degrees value
public static float Sin(float radians) // Sine of angle in radians
public static float Cos(float radians) // Cosine of angle in radians
public static float Tan(float radians) // Tangent of angle in radians
public static float Asin(float value) // Arcsine (inverse sine) of value
public static float Acos(float value) // Arccosine (inverse cosine) of value
public static float Atan(float value) // Arctangent (inverse tangent) of value
public static float Atan2(float y, float x) // Arctangent of y/x considering quadrant
public static float Sqrt(float value) // Square root
public static float Abs(float value) // Absolute value
public static float Floor(float value) // Round down to nearest integer (float)
public static int FloorToInt(float value) // Round down to nearest integer (int)
public static float Ceil(float value) // Round up to nearest integer (float)
public static int CeilToInt(float value) // Round up to nearest integer (int)
public static float Round(float value) // Round to nearest integer (float)
public static int RoundToInt(float value) // Round to nearest integer (int)
public static float Min(float a, float b) // Return smaller of a and b
public static float Max(float a, float b) // Return larger of a and b
public static float Clamp01(float value) // Clamp value between 0 and 1
public static float Clamp(float value, float min, float max) // Clamp value between min and max
public static float Sign(float value) // Sign of value
public static float Pow(float x, float y) // Raise x to power y
public static float Exp(float x) // Exponential of x
public static float Log(float x) // Natural logarithm (ln)
public static float Log10(float x) // Base-10 logarithm
public static bool IsPowerOfTwo(int value) // Is value is a power of 2
public static float Repeat(float t, float length) // Loop value t between 0 and length
public static float PingPong(float t, float min, float max) // Oscillates t between min and max
public static float DegreesToRadians(float degrees) // Convert degrees to radians
public static float RadiansToDegrees(float radians) // Convert radians to degrees
public static float Lerp(float a, float b, float t) // Linear interpolation (clamped 0-1)
public static float LerpUnclamped(float a, float b, float t) // Linear interpolation without clamping
public static bool Approximately(float a, float b, float epsilon = 1e-5f) // Is a & b approximately the same using epsilon range
public static void SetRandomSeed(int seed) // Set the random seed
public static int GetRandomSeed() // Get the random seed
public static float GetRandomValue(float min, float max) // Get random value between min and max with seed

Color.cs (struct)

public float r // Red Value (0 - 1)
public float g // Green Value (0 - 1)
public float b // Blue Value (0 - 1)
public float a // Alpha Value (0 - 1)
public Color(float r, float g, float b, float a = 1f) // Constructor

Point.cs (struct)

public float x; // X Value
public float y; // Y Value
public Point(float x, float y) // Constructor

Rect.cs (struct)

public float x; // X Value
public float y; // Y Value
public float width; // Width Value
public float height; // Height Value
public Rect(float x, float y, float width, float height) // Constructor