Tea — a strongly typed scripting language
Tea
DocsPlaygroundExamplesReferenceCommunity
GitHub

Tea Language

A strongly typed scripting language for native tools.

© 2026 Tea Language.

Agent documentationContributingCommunityRepository

Language Runtime

Built-ins

Standard Library

std.argsstd.assertstd.audiostd.encodingstd.envstd.fsstd.hashstd.httpstd.netstd.jsonstd.mathstd.parsestd.pathstd.processstd.randomstd.raylibstd.regexstd.stringstd.timestd.url

Read as Markdown

Standard Library

std.raylib

Native Raylib bindings. Requires an installed Raylib library. C symbol names are preserved. See docs/guide/native-bindings.md for ABI rules. Struct calls currently require arm64 macOS. Checked against Raylib 6.0.

Exported functions

pub extern "raylib" def SetConfigFlags(flags: CUInt) -> Void

Configure window flags before InitWindow.

pub extern "raylib" def SetWindowMinSize(width: CInt, height: CInt) -> Void

Set the minimum size of a resizable window.

pub extern "raylib" def LoadTexture(path: CString) -> Texture

Load an image file into GPU memory; requires an open graphics context. Check IsTextureValid, then pair each successful load with one UnloadTexture.

pub extern "raylib" def IsTextureValid(texture: Texture) -> CBool

Validate texture metadata after loading; this does not detect a previously unloaded handle.

pub extern "raylib" def UnloadTexture(texture: Texture) -> Void

Release a texture before closing its graphics context. Never use any copies afterward.

pub extern "raylib" def DrawTexture(texture: Texture, x: CInt, y: CInt, tint: Color) -> Void

Draw a texture at an integer position.

pub extern "raylib" def DrawTextureV(texture: Texture, position: Vector2, tint: Color) -> Void

Draw a texture at a two-dimensional position.

pub extern "raylib" def DrawTexturePro(texture: Texture, source: Rectangle, destination: Rectangle, origin: Vector2, rotation: CFloat, tint: Color) -> Void

Draw part of a texture with scaling and rotation.

pub extern "raylib" def SetTextureFilter(texture: Texture, filter: CInt) -> Void

Choose a texture scaling filter.

pub extern "raylib" def InitWindow(width: CInt, height: CInt, title: CStaticString) -> Void

Create the window and graphics context. Call from the main thread.

pub extern "raylib" def CloseWindow() -> Void

Close the window and release its graphics context.

pub extern "raylib" def WindowShouldClose() -> CBool

Check whether the close button or exit key requested shutdown.

pub extern "raylib" def IsWindowReady() -> CBool

Check whether window initialization succeeded.

pub extern "raylib" def SetWindowTitle(title: CStaticString) -> Void

Change the window title. Raylib retains this read-only string.

pub extern "raylib" def SetWindowSize(width: CInt, height: CInt) -> Void

Resize the window.

pub extern "raylib" def GetScreenWidth() -> CInt

Get the window's logical width.

pub extern "raylib" def GetScreenHeight() -> CInt

Get the window's logical height.

pub extern "raylib" def BeginDrawing() -> Void

Begin drawing a frame.

pub extern "raylib" def EndDrawing() -> Void

Present the frame and process timing/input.

pub extern "raylib" def rlClearScreenBuffers() -> Void

Clear the frame using rlgl's current clear color (black by default). Prefer ClearBackground for the public drawing API.

pub extern "raylib" def DrawFPS(x: CInt, y: CInt) -> Void

Draw the current frame rate at a screen position.

pub extern "raylib" def ClearBackground(color: Color) -> Void

Clear the frame to a color.

pub extern "raylib" def DrawCircleV(center: Vector2, radius: CFloat, color: Color) -> Void

Draw a filled circle at a two-dimensional position.

pub extern "raylib" def DrawRectangleRec(rectangle: Rectangle, color: Color) -> Void

Draw a filled rectangle.

pub extern "raylib" def DrawText(text: CString, x: CInt, y: CInt, font_size: CInt, color: Color) -> Void

Draw text using the default font; the string is borrowed for this call only.

pub extern "raylib" def GetMousePosition() -> Vector2

Get the mouse position in screen coordinates.

pub extern "raylib" def Fade(color: Color, alpha: CFloat) -> Color

Return a color with the supplied alpha between zero and one.

pub extern "raylib" def GetCollisionRec(first: Rectangle, second: Rectangle) -> Rectangle

Return the intersection of two rectangles.

pub extern "raylib" def SetTargetFPS(fps: CInt) -> Void

Limit the frame rate.

pub extern "raylib" def GetFrameTime() -> CFloat

Return the most recent frame's duration in seconds.

pub extern "raylib" def GetTime() -> CDouble

Return elapsed time since initialization, in seconds.

pub extern "raylib" def IsKeyDown(key: CInt) -> CBool

Test whether a keyboard key is held down.

pub extern "raylib" def IsKeyPressed(key: CInt) -> CBool

Test whether a keyboard key was pressed this frame.

pub extern "raylib" def SetRandomSeed(seed: CUInt) -> Void

Seed Raylib's random number generator.

pub extern "raylib" def GetRandomValue(min: CInt, max: CInt) -> CInt

Return a random integer in the inclusive range.

pub def with_window(width: Int, height: Int, title: String, run: Func() -> Void) -> Bool

Run a callback with an open window, then close it. Returns false on initialization failure. Call on the main thread; windows cannot be nested (Raylib has one global context). The callback may return early. It cannot throw; panic/exit/process termination bypass cleanup. Release textures inside the callback, before this helper closes the graphics context.

pub def with_texture(filename: String, run: Func(Texture) -> Void) -> Bool

Borrow a loaded texture for a callback, then unload it. Returns false if loading fails. Do not unload the borrowed texture or retain/use copies outside the callback. Panic/exit/process termination bypass cleanup; this is not automatic ownership checking.

pub def drawing(run: Func() -> Void) -> Void

Pair BeginDrawing/EndDrawing around a non-throwing callback, including early returns.