Defold gui system

Defold GUI system

Namespace: dmGui
Include: #include <dmsdk/gui/gui.h>
FUNCTIONS
void AdjustMode()
void AdjustReference()
void DeleteNode(dmGui::HScene scene, dmGui::HNode node) Defer delete a node
dmGui::HNode GetFirstChildNode(dmGui::HScene scene, dmGui::HNode node) Get first child node
dmGui::HNode GetNextNode(dmGui::HScene scene, dmGui::HNode node) Get next sibling
uint32_t GetNodeCustomData(dmGui::HScene scene, HNode node) get node custom type
void* GetNodeCustomData(dmGui::HScene scene, HNode node) get node custom data
dmhash_t GetNodeId(dmGui::HScene scene, dmGui::HNode node) Get the id of a node.
bool GetNodeIsBone(dmGui::HScene scene, dmGui::HNode node) Query if the node is a bone
dmGui::HNode GetNodeParent(dmGui::HScene scene, dmGui::HNode node) Get the parent of a gui node
dmVMath::Vector4 GetNodeProperty( scene,  node, dmGui::Property property) Get property value
dmhash_t GetNodeTextureId(dmGui::HScene scene, HNode node) get node texture
void* GetResource(dmGui::HScene scene, dmhash_t resource_id, dmhash_t suffix_with_dot) Gets a resource by its resource alias.
void HContext() A handle to a gui context
void HNode() A handle to a gui node
void HScene() A handle to a gui scene
void HScript() A handle to a gui script
void HTextureSource() A handle to a texture source, which can be a point...
void INVALID_HANDLE() Invalid node handle
void LuaPushNode(lua_State* L, dmGui::HScene scene, HNode node) Pushes a dmGui::HNode to the stack
dmGui::HNode NewNode(dmGui::HScene scene, dmVMath::Point3 position, dmVMath::Vector3 size, dmGui::NodeType node_type, uint32_t custom_type)
void NodeTextureType() This enum denotes what kind of texture type the m_...
void Playback()
void Property()
void Result()
void Result()
void SetNodeAdjustMode( scene,  node, AdjustMode adjust_mode) Set adjust mode
void SetNodeId(dmGui::HScene scene, dmGui::HNode node, dmhash_t id) Set the id of a node.
void SetNodeIsBone(dmGui::HScene scene, dmGui::HNode node, bool is_bone) Set the bone state of the node
dmGui::Result SetNodeParent(dmGui::HScene scene, dmGui::HNode node, dmGui::HNode parent, bool keep_scene_transform) Set the parent of a gui node
void SetNodeProperty( scene,  node, dmGui::Property property, dmVMath::Vector4 value) Set property value
void SetNodeTexture(dmGui::HScene scene, HNode node, dmhash_t texture_id) set node texture
void SetNodeTexture(dmGui::HScene scene, HNode node, NodeTextureType type, void* texture) set node texture

Functions

AdjustMode

void AdjustMode()

PARAMETERS


AdjustReference

void AdjustReference()

PARAMETERS


DeleteNode

void DeleteNode(dmGui::HScene scene, dmGui::HNode node)

Defer delete a node

PARAMETERS

dmGui::HScene scene the gui scene
dmGui::HNode node the node to delete

GetFirstChildNode

dmGui::HNode GetFirstChildNode(dmGui::HScene scene, dmGui::HNode node)

Get first child node

PARAMETERS

dmGui::HScene scene the gui scene
dmGui::HNode node Gets the first child node. If 0, gets the first top level node.

RETURNS

dmGui::HNode The first child node

GetNextNode

dmGui::HNode GetNextNode(dmGui::HScene scene, dmGui::HNode node)

Get next sibling

PARAMETERS

dmGui::HScene scene the gui scene
dmGui::HNode node the current sibling

RETURNS

dmGui::HNode the next sibling, or INVALID_HANDLE if no more siblings

GetNodeCustomData

uint32_t GetNodeCustomData(dmGui::HScene scene, HNode node)

get node custom type

PARAMETERS

dmGui::HScene scene the gui scene
HNode node the gui node

RETURNS

uint32_t the custom type. Or 0 if it is no custom type

GetNodeCustomData

void* GetNodeCustomData(dmGui::HScene scene, HNode node)

get node custom data

PARAMETERS

dmGui::HScene scene the gui scene
HNode node the gui node

RETURNS

void* the custom data created per node by the gui node type extension

GetNodeId

dmhash_t GetNodeId(dmGui::HScene scene, dmGui::HNode node)

Get the id of a node.

PARAMETERS

dmGui::HScene scene the gui scene
dmGui::HNode node the gui node

RETURNS

dmhash_t the id of the node

GetNodeIsBone

bool GetNodeIsBone(dmGui::HScene scene, dmGui::HNode node)

Query if the node is a bone

PARAMETERS

dmGui::HScene scene the gui scene
dmGui::HNode node the gui node

RETURNS

bool true if the node is a bone

GetNodeParent

dmGui::HNode GetNodeParent(dmGui::HScene scene, dmGui::HNode node)

Get the parent of a gui node

PARAMETERS

dmGui::HScene scene the gui scene
dmGui::HNode node the gui node

RETURNS

dmGui::HNode the parent, or INVALID_HANDLE is unsuccessful

GetNodeProperty

dmVMath::Vector4 GetNodeProperty( scene,  node, dmGui::Property property)

Get property value

PARAMETERS

scene type: dmGui::HScene] scene
node type: dmGui::HNode] node
dmGui::Property property property enum

RETURNS

dmVMath::Vector4

GetNodeTextureId

dmhash_t GetNodeTextureId(dmGui::HScene scene, HNode node)

get node texture

PARAMETERS

dmGui::HScene scene the gui scene
HNode node the gui node

RETURNS

dmhash_t the currently assigned texture

GetResource

void* GetResource(dmGui::HScene scene, dmhash_t resource_id, dmhash_t suffix_with_dot)

Gets a resource by its resource alias.

PARAMETERS

dmGui::HScene scene the gui scene
dmhash_t resource_id the resource alias
dmhash_t suffix_with_dot the hash of the suffix: hash(".spinescenec")

RETURNS

void* the resource if successful

HContext

void HContext()

A handle to a gui context

PARAMETERS


HNode

void HNode()

A handle to a gui node

PARAMETERS


HScene

void HScene()

A handle to a gui scene

PARAMETERS


HScript

void HScript()

A handle to a gui script

PARAMETERS


HTextureSource

void HTextureSource()

A handle to a texture source, which can be a pointer to a resource, a dmGraphics::HTexture or a dynamic texture created from a gui script.

PARAMETERS


INVALID_HANDLE

void INVALID_HANDLE()

Invalid node handle

PARAMETERS


LuaPushNode

void LuaPushNode(lua_State* L, dmGui::HScene scene, HNode node)

Pushes a dmGui::HNode to the stack

PARAMETERS

lua_State* L the Lua scene
dmGui::HScene scene the gui scene
HNode node the gui node

NewNode

dmGui::HNode NewNode(dmGui::HScene scene, dmVMath::Point3 position, dmVMath::Vector3 size, dmGui::NodeType node_type, uint32_t custom_type)

PARAMETERS

dmGui::HScene scene the gui scene
dmVMath::Point3 position the position
dmVMath::Vector3 size the size
dmGui::NodeType node_type the node type
uint32_t custom_type If node_type == dmGui::NODE_TYPE_CUSTOM, then this is used to create a custom node data for the registered custom type

RETURNS

dmGui::HNode the created node

NodeTextureType

void NodeTextureType()

This enum denotes what kind of texture type the m_Texture pointer is referencing.

PARAMETERS


Playback

void Playback()

PARAMETERS


Property

void Property()

PARAMETERS


Result

void Result()

PARAMETERS


Result

void Result()

PARAMETERS


SetNodeAdjustMode

void SetNodeAdjustMode( scene,  node, AdjustMode adjust_mode)

Set adjust mode

PARAMETERS

scene type: dmGui::HScene] scene
node type: dmGui::HNode] node
AdjustMode adjust_mode the adjust mode

SetNodeId

void SetNodeId(dmGui::HScene scene, dmGui::HNode node, dmhash_t id)

Set the id of a node.

PARAMETERS

dmGui::HScene scene the gui scene
dmGui::HNode node the gui node
dmhash_t id the id

SetNodeIsBone

void SetNodeIsBone(dmGui::HScene scene, dmGui::HNode node, bool is_bone)

Set the bone state of the node

PARAMETERS

dmGui::HScene scene the gui scene
dmGui::HNode node the gui node
bool is_bone true if the node is ot be used as a bone

SetNodeParent

dmGui::Result SetNodeParent(dmGui::HScene scene, dmGui::HNode node, dmGui::HNode parent, bool keep_scene_transform)

Set the parent of a gui node

PARAMETERS

dmGui::HScene scene the gui scene
dmGui::HNode node the gui node
dmGui::HNode parent the new parent. May be null
bool keep_scene_transform true to keep the world position

RETURNS

dmGui::Result dmGui::RESULT_OK is successful

SetNodeProperty

void SetNodeProperty( scene,  node, dmGui::Property property, dmVMath::Vector4 value)

Set property value

PARAMETERS

scene type: dmGui::HScene] scene
node type: dmGui::HNode] node
dmGui::Property property property enum
dmVMath::Vector4 value

SetNodeTexture

void SetNodeTexture(dmGui::HScene scene, HNode node, dmhash_t texture_id)

set node texture

PARAMETERS

dmGui::HScene scene the gui scene
HNode node the gui node
dmhash_t texture_id the texture id

SetNodeTexture

void SetNodeTexture(dmGui::HScene scene, HNode node, NodeTextureType type, void* texture)

set node texture

PARAMETERS

dmGui::HScene scene the gui scene
HNode node the gui node
NodeTextureType type the type of texture
void* texture A pointer to a e.g. dmGameSystem::TextureSetResource*