DatumHuePlatform v0.0.24datumhue.com
Contents

namespace10 functions, 2 fields

datumhue

The table every app is given as the global datumhue: its namespaces, and the functions and fields on it directly.

Functions 10

datumhue.uuid

function
datumhue.uuid() -> string

Generate a fresh random UUID in canonical hyphenated form.

datumhue.stat

function
datumhue.stat(key: StatKey) -> number | integer

Query a performance counter by key. A counter that has not produced a sample yet reports 0. An unknown key raises.

datumhue.on_update

function
datumhue.on_update(callback: (fun(dt: number))?)

Register the per-frame update handler; dt is the seconds since the previous invocation. At most one handler is active per app — calling again replaces the previous one. Pass nil to clear it. Timer callbacks due in a frame run before it in that frame. At most one invocation is in flight: frames that pass while one is still running (a suspending call keeps it running) start none, and their time accrues into the next dt.

datumhue.on_terminate

function
datumhue.on_terminate(callback: (fun())?)

Register the termination handler. It runs once, when the app is being terminated — its own terminate, a manager's terminate_app, an ancestor's termination cascading down, or a service app ending with nothing left to run — but not when the app crashes or the workstation itself exits. The handler gets a short, bounded time budget to flush state; suspending calls are allowed and the budget keeps counting while they wait, and when it runs out the ending goes on regardless. It cannot cancel the termination. When a termination cascades to several descendants, the order in which their handlers run is unspecified. Registering a handler does not keep an idle service app alive. At most one handler is active per app — calling again replaces the previous one, and one registered while the handler runs never runs. Pass nil to clear it.

datumhue.ready

functionsuspends
datumhue.ready(handles: any[])

Wait until every handle in the array is ready — a barrier across a mixed batch of loadable assets (Image, AudioAsset, SceneAsset, CubemapAsset, Font, Shader, DataHandle), Bytes (file-backed bytes are read into memory, as their :ready() does), and request handles (each class with a :ready() method). Returns nothing; chain a single handle with its own :ready() instead. Raises on the first failure. A never-arriving remote target waits indefinitely.

Example
local store = datumhue.storage.open()
local name = store:get("name")
local level = store:get("level")
-- One wait for both lookups.
datumhue.ready({ name, level })
print(name.state, level.state) --> ready ready

datumhue.bytes

function
datumhue.bytes(s: string) -> Bytes

Lift a Lua string to opaque Bytes.

datumhue.math.vec2

function
datumhue.math.vec2(x: number, y: number) -> Vec2

Construct a 2D vector: vec2() is (0,0), vec2(s) splats, vec2(x, y) is component-wise.

Also accepts:

datumhue.math.vec2() -> Vec2
datumhue.math.vec2(scalar: number) -> Vec2
Example
print(datumhue.math.vec2()) --> vec2(0.0, 0.0)
-- One number fills both components.
print(datumhue.math.vec2(2)) --> vec2(2.0, 2.0)
print(datumhue.math.vec2(3, 4)) --> vec2(3.0, 4.0)

datumhue.math.vec3

function
datumhue.math.vec3(x: number, y: number, z: number) -> Vec3

Construct a 3D vector: vec3() is (0,0,0), vec3(s) splats, vec3(x, y) sets z=0, vec3(x, y, z) is component-wise.

Also accepts:

datumhue.math.vec3() -> Vec3
datumhue.math.vec3(scalar: number) -> Vec3
datumhue.math.vec3(x: number, y: number) -> Vec3
Example
print(datumhue.math.vec3()) --> vec3(0.0, 0.0, 0.0)
print(datumhue.math.vec3(2)) --> vec3(2.0, 2.0, 2.0)
-- Two numbers set x and y, and z is 0.
print(datumhue.math.vec3(3, 4)) --> vec3(3.0, 4.0, 0.0)
print(datumhue.math.vec3(3, 4, 5)) --> vec3(3.0, 4.0, 5.0)

datumhue.math.ray

function
datumhue.math.ray(origin: Vec3, direction: Vec3) -> Ray

Construct a ray from an origin and a direction (normalized on construction). Raises if the origin is not finite or the direction is zero or not finite.

Example
-- The direction is normalized: 4 units along -Z becomes 1.
local origin = datumhue.math.vec3(0, 1, 0)
local ray = datumhue.math.ray(origin, datumhue.math.vec3(0, 0, -4))
print(ray.direction) --> vec3(0.0, 0.0, -1.0)

datumhue.color

function
datumhue.color(r: number, g: number, b: number, a?: number) -> Color

Construct a color from a hex string (#RRGGBB/#RRGGBBAA) or r, g, b[, a] numbers (0..1).

Also accepts:

datumhue.color(hex: string) -> Color
Example
-- A hex string, or r, g, b and an optional alpha, each 0 to 1.
print(datumhue.color("#ff0000")) --> color(1.0, 0.0, 0.0, 1.0)
print(datumhue.color(0.25, 0.5, 1)) --> color(0.25, 0.5, 1.0, 1.0)
print(datumhue.color(0.25, 0.5, 1, 0.5)) --> color(0.25, 0.5, 1.0, 0.5)

Fields 2

FieldTypeAccessDescription
argsAppArgsread-onlyFilesystem and launch capabilities granted to this app at spawn.
packagePackage?read-onlyThe running app's own loaded package bundle — its manifest metadata (.name, :version(), :kind()) and a read-only :dir() over its files. nil when the app was launched from inline code rather than a package.

Types 2

AppArgs

record

record 6 keys

KeyTypeDescription
dirstable<string, Dir>Granted directory capabilities, keyed by mount name.
filestable<string, File>Granted file capabilities, keyed by mount name.
data_mountstable<string, DataMount>Granted data-mount capabilities, keyed by mount name.
http_mountstable<string, HttpMount>Granted HTTP mount capabilities, keyed by mount name.
ingress_mountstable<string, IngressMount>Granted ingress mount capabilities, keyed by mount name.
argvstring[]Positional launch arguments passed to this app.

Used by: datumhue.args

StatKey

enum
ValueDescription
"fps"Smoothed frames per second.
"frame_time"Smoothed frame time in seconds.
"frame_count"Frames rendered since launch.
"entity_count"Objects alive across the whole workstation, its own and every running app's: UI elements, draw primitives, scene nodes and the like.
"app_count"Apps running on the workstation, the bootstrap included.
"cpu"Fraction of the per-frame script budget this app consumed during the previous frame. Raw per-frame value, no smoothing.
"memory"Script memory currently allocated by this app, in bytes.

Used by: datumhue.stat

datumhue.com

(c) 2026 Shuusei AB. Quote excerpts of this manual, with attribution to DatumHue, in your own documentation, tutorials, course materials, reviews, and other writing or video. Republishing it in whole or in substantial part needs written permission: support@datumhue.com.

Victor Mono is licensed under the SIL Open Font License 1.1
Copyright (c) 2024, Rune Bjørnerås (https://github.com/rubjo)

This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL


-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------

PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.

The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.

DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.

"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).

"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).

"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.

"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.

PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:

1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.

2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.

3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.

4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.

5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.

TERMINATION
This license becomes null and void if any of the above conditions are
not met.

DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.

Try

    ↑↓ selectEnter openTab filter

    Settings

    Theme
    Text
    Print

    Keyboard shortcuts

    / or Ctrl KSearch
    ↑ ↓ EnterPick a result
    TabNext result filter
    j kNext or previous entry
    [ ]Previous or next page
    yCopy a link to the current entry
    ?These shortcuts
    EscClose

    On this page