API Reference | developer.brewmp.com API Reference | developer.brewmp.com


API Reference


Brew Release
Brew MP 1.0.2
Returns the element whose GUID matches the guid parameter.
The returned interface pointer is NOT AddRef'd; the caller should not Release it.
A pointer to an ITrigmlDocument object.
The GUID of the element.

  •    ITrigmlElement* ITRIGMLDOCUMENT_GetElementByGuid(ITrigmlDocument* po, uint32 guid)
  •    A pointer to the element identified by the id parameter.
       NULL if no such element exists.
Side Effect
  • None
Every TrigML element is assigned a Globally Unique IDentifier when it is created. These numbers are intended to be unique during the lifetime of a particular TrigML document (in the unlikely event that 32 bits worth of GUIDs are exhausted, TrigPlayer will start re-assigning unused GUIDs). The GUIDs assigned to your elements are at the discretion of the player and should not be relied upon to be consistent between different executions of the same content. However, it is useful to be able to fetch an element by its GUID when writing a Lua library for use with TrigPlayer, because every Lua table representing a TrigML element will return that element's GUID when indexed with the key "_gid". (Use ILUA_GetTable() when querying the GUID, not ILUA_RawGet()). _root always has GUID 0, but it is faster to call ITRIGMLDOCUMENT_GetRoot() to access the root element. MAX_UINT32 is never used as a GUID.