DRAWING FUNCTIONS

LoadTextureFromBuffer

Creates a texture from an in-memory image buffer.

Syntax

local texId, w, h = ONYX.LoadTextureFromBuffer(data)

Parameters

  • data (string) — Encoded image bytes (PNG/JPG/BMP/GIF/TGA).

Return(s)

texId (number), w (number), h (number) — texture handle and pixel size.

Behavior

  • Same formats and rules as LoadTexture.
  • Useful for downloaded or in-memory assets.

Example(s)

local texId, w, h = ONYX.LoadTextureFromBuffer(imageBytes)