Defold GUI system
| Namespace: | dmGui |
| Include: | #include <dmsdk/gui/gui.h> |
| TYPES | |
|---|---|
| HContext | A handle to a gui context |
| HNode | A handle to a gui node |
| HScene | A handle to a gui scene |
| HScript | A handle to a gui script |
| HTextureSource | A handle to a texture source, which can be a point... |
| ENUMS | |
|---|---|
| AdjustMode | |
| AdjustReference | |
| CustomPropertyType | |
| NodeTextureType | This enum denotes what kind of texture type the m_... |
| Playback | |
| Property | |
| Result | |
| Result |
| STRUCTS | |
|---|---|
| struct CustomProperty | Custom GUI node property value |
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 |
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 |
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 |
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 |
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 |
dmGui::Result GetNodeCustomProperty(dmGui::HScene scene, dmGui::HNode node, dmhash_t key, dmGui::CustomProperty* prop)
Get a custom property from a GUI node. String values returned in the output property are owned by the GUI scene and must not be freed by the caller.
PARAMETERS
dmGui::HScene |
scene |
scene |
dmGui::HNode |
node |
node |
dmhash_t |
key |
property name hash |
dmGui::CustomProperty* |
prop |
output property |
RETURNS
dmGui::Result |
RESULT_OK on success |
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 |
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 |
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 |
dmVMath::Vector4 GetNodeProperty(dmGui::HScene scene, dmGui::HNode node, dmGui::Property property)
Get property value
PARAMETERS
dmGui::HScene |
scene |
scene |
dmGui::HNode |
node |
node |
dmGui::Property |
property |
property enum |
RETURNS
dmVMath::Vector4 |
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 |
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 |
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 |
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 |
void SetNodeAdjustMode(dmGui::HScene scene, dmGui::HNode node, AdjustMode adjust_mode)
Set adjust mode
PARAMETERS
dmGui::HScene |
scene |
scene |
dmGui::HNode |
node |
node |
AdjustMode |
adjust_mode |
the adjust mode |
dmGui::Result SetNodeCustomProperty(dmGui::HScene scene, dmGui::HNode node, dmhash_t key, const dmGui::CustomProperty* prop)
Set a custom property on a GUI node. String values are copied, and the caller retains ownership of the input string.
PARAMETERS
dmGui::HScene |
scene |
scene |
dmGui::HNode |
node |
node |
dmhash_t |
key |
property name hash |
const dmGui::CustomProperty* |
prop |
property value |
RETURNS
dmGui::Result |
RESULT_OK on success |
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 |
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 |
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 |
void SetNodeProperty(dmGui::HScene scene, dmGui::HNode node, dmGui::Property property, dmVMath::Vector4 value)
Set property value
PARAMETERS
dmGui::HScene |
scene |
scene |
dmGui::HNode |
node |
node |
dmGui::Property |
property |
property enum |
dmVMath::Vector4 |
value |
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 |
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* |
TYPE
struct CustomPropertyCustom GUI node property value. String values returned from GetNodeCustomProperty() are owned by the GUI scene and must not be freed by the caller. String values passed to SetNodeCustomProperty() are copied.
MEMBERS
dmGui::CustomPropertyType |
m_Type |
the value type |
void HContext()
A handle to a gui context
PARAMETERS
void HNode()
A handle to a gui node
PARAMETERS
void HScene()
A handle to a gui scene
PARAMETERS
void HScript()
A handle to a gui script
PARAMETERS
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
ADJUST_MODE_FIT |
//!< 0 |
ADJUST_MODE_ZOOM |
//!< 1 |
ADJUST_MODE_STRETCH |
//!< 2 |
ADJUST_REFERENCE_PARENT |
|
ADJUST_REFERENCE_DISABLED |
CUSTOM_PROPERTY_TYPE_NUMBER |
|
CUSTOM_PROPERTY_TYPE_BOOLEAN |
|
CUSTOM_PROPERTY_TYPE_HASH |
|
CUSTOM_PROPERTY_TYPE_STRING |
|
CUSTOM_PROPERTY_TYPE_VECTOR3 |
|
CUSTOM_PROPERTY_TYPE_VECTOR4 |
|
CUSTOM_PROPERTY_TYPE_QUAT |
This enum denotes what kind of texture type the m_Texture pointer is referencing.
NODE_TEXTURE_TYPE_NONE |
|
NODE_TEXTURE_TYPE_TEXTURE |
|
NODE_TEXTURE_TYPE_TEXTURE_SET |
PLAYBACK_ONCE_FORWARD |
|
PLAYBACK_ONCE_BACKWARD |
|
PLAYBACK_ONCE_PINGPONG |
|
PLAYBACK_LOOP_FORWARD |
|
PLAYBACK_LOOP_BACKWARD |
|
PLAYBACK_LOOP_PINGPONG |
|
PLAYBACK_NONE |
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 |
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_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 |