Gui

Defold GUI system

HContext()

A handle to a gui context

A handle to a gui context


HScene()

A handle to a gui scene

A handle to a gui scene


HNode()

A handle to a gui node

A handle to a gui node


HScript()

A handle to a gui script

A handle to a gui script


HTextureSource()

A handle to a texture source, which can be a point...

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.


INVALID_HANDLE()

Invalid node handle

Invalid node handle


Playback()

MEMBERS

PLAYBACK_ONCE_FORWARD -

PLAYBACK_ONCE_BACKWARD -

PLAYBACK_ONCE_PINGPONG -

PLAYBACK_LOOP_FORWARD -

PLAYBACK_LOOP_BACKWARD -

PLAYBACK_LOOP_PINGPONG -

PLAYBACK_NONE -


AdjustReference()

MEMBERS

ADJUST_REFERENCE_PARENT -

ADJUST_REFERENCE_DISABLED -


NodeTextureType()

This enum denotes what kind of texture type the m_...

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

MEMBERS

NODE_TEXTURE_TYPE_NONE -

NODE_TEXTURE_TYPE_TEXTURE -

NODE_TEXTURE_TYPE_TEXTURE_SET -

NODE_TEXTURE_TYPE_DYNAMIC -


Result()

MEMBERS

NODE_TYPE_BOX - //!< 0,

NODE_TYPE_TEXT - //!< 1,

NODE_TYPE_PIE - //!< 2,

NODE_TYPE_TEMPLATE - //!< 3,

NODE_TYPE_PARTICLEFX - //!< 5,

NODE_TYPE_CUSTOM - //!< 6,

NODE_TYPE_COUNT - //!< 7,


Result()

MEMBERS

RESULT_OK - //!< 0

RESULT_SYNTAX_ERROR - //!< -1

RESULT_SCRIPT_ERROR - //!< -2

RESULT_OUT_OF_RESOURCES - //!< -4

RESULT_RESOURCE_NOT_FOUND - //!< -5

RESULT_TEXTURE_ALREADY_EXISTS - //!< -6

RESULT_INVAL_ERROR - //!< -7

RESULT_INF_RECURSION - //!< -8

RESULT_DATA_ERROR - //!< -9

RESULT_WRONG_TYPE - //!< -10


NewNode(scene, position, size, node_type, custom_type)

PARAMETERS

scene - the gui scene

position - the position

size - the size

node_type - the node type

custom_type - If node_type == dmGui::NODE_TYPE_CUSTOM, then this is used to create a custom node data for the registered custom type

RETURN

node - the created node


DeleteNode(scene, node)

Defer delete a node

Defer delete a node

PARAMETERS

scene - the gui scene

node - the node to delete


SetNodeId(scene, node, id)

Set the id of a node.

Set the id of a node.

PARAMETERS

scene - the gui scene

node - the gui node

id - the id


GetNodeId(scene, node)

Get the id of a node.

Get the id of a node.

PARAMETERS

scene - the gui scene

node - the gui node

RETURN

id - the id of the node


SetNodeParent(scene, node, parent, keep_scene_transform)

Set the parent of a gui node

Set the parent of a gui node

PARAMETERS

scene - the gui scene

node - the gui node

parent - the new parent. May be null

keep_scene_transform - true to keep the world position

RETURN

result - dmGui::RESULT_OK is successful


GetNodeParent(scene, node)

Get the parent of a gui node

Get the parent of a gui node

PARAMETERS

scene - the gui scene

node - the gui node

RETURN

parent - the parent, or INVALID_HANDLE is unsuccessful


GetFirstChildNode(scene, node)

Get first child node

Get first child node

PARAMETERS

scene - the gui scene

node - Gets the first child node. If 0, gets the first top level node.

RETURN

child - The first child node


GetNextNode(scene, node)

Get next sibling

Get next sibling

PARAMETERS

scene - the gui scene

node - the current sibling

RETURN

sibling - the next sibling, or INVALID_HANDLE if no more siblings


GetNodeIsBone(scene, node)

Query if the node is a bone

Query if the node is a bone

PARAMETERS

scene - the gui scene

node - the gui node

RETURN

result - true if the node is a bone


SetNodeIsBone(scene, node, is_bone)

Set the bone state of the node

Set the bone state of the node

PARAMETERS

scene - the gui scene

node - the gui node

is_bone - true if the node is ot be used as a bone


Property()

MEMBERS

PROPERTY_POSITION - //!< 0

PROPERTY_ROTATION - //!< 1

PROPERTY_SCALE -

  //!< 2

PROPERTY_COLOR -

  //!< 3

PROPERTY_SIZE -

   //!< 4

PROPERTY_OUTLINE -

//!< 5

PROPERTY_SHADOW -

 //!< 6

PROPERTY_SLICE9 -

 //!< 7

PROPERTY_PIE_PARAMS - //!< 8

PROPERTY_TEXT_PARAMS - //!< 9

PROPERTY_COUNT -

  //!< 10


GetNodeProperty(scene, node, property)

Get property value

Get property value

PARAMETERS

scene - type: dmGui::HScene] scene

node - type: dmGui::HNode] node

property - property enum

RETURN

value -


SetNodeProperty(scene, node, property, value)

Set property value

Set property value

PARAMETERS

scene - type: dmGui::HScene] scene

node - type: dmGui::HNode] node

property - property enum

value -


AdjustMode()

MEMBERS

ADJUST_MODE_FIT -

//!< 0

ADJUST_MODE_ZOOM - //!< 1

ADJUST_MODE_STRETCH - //!< 2


SetNodeAdjustMode(scene, node, adjust_mode)

Set adjust mode

Set adjust mode

PARAMETERS

scene - type: dmGui::HScene] scene

node - type: dmGui::HNode] node

adjust_mode - the adjust mode


GetNodeCustomData(scene, node)

get node custom type

get node custom type

PARAMETERS

scene - the gui scene

node - the gui node

RETURN

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


GetNodeCustomData(scene, node)

get node custom data

get node custom data

PARAMETERS

scene - the gui scene

node - the gui node

RETURN

data - the custom data created per node by the gui node type extension


GetNodeTextureId(scene, node)

get node texture

get node texture

PARAMETERS

scene - the gui scene

node - the gui node

RETURN

texture - the currently assigned texture


SetNodeTexture(scene, node, texture_id)

set node texture

set node texture

PARAMETERS

scene - the gui scene

node - the gui node

texture_id - the texture id


SetNodeTexture(scene, node, type, texture)

set node texture

set node texture

PARAMETERS

scene - the gui scene

node - the gui node

type - the type of texture

texture - A pointer to a e.g. dmGameSystem::TextureSetResource*


GetResource(scene, resource_id, suffix_with_dot)

Gets a resource by its resource alias.

Gets a resource by its resource alias.

PARAMETERS

scene - the gui scene

resource_id - the resource alias

suffix_with_dot - the hash of the suffix: hash(".spinescenec")

RETURN

resource - the resource if successful


LuaPushNode(L, scene, node)

Pushes a dmGui::HNode to the stack

Pushes a dmGui::HNode to the stack

PARAMETERS

L - the Lua scene

scene - the gui scene

node - the gui node