GuiLoadDocument

From Wiki G1R-MP G1 Remake Multiplayer
Jump to navigation Jump to search

guiLoadDocument

Loads an RML document owned by the current client resource.

Syntax

DocumentHandle guiLoadDocument(string relativePath)

Parameters

Name Type Required Description
relativePath string yes Path to the RML file relative to the resource root.

Returns

Returns a document handle on success, or an invalid handle when loading fails.

Examples

Load and display a HUD document:

local hud = guiLoadDocument("ui/hud.rml")
if hud then
    guiShow(hud)
end

Notes

  • Available only in client-side resource scripts.
  • Document paths cannot escape the current resource directory.