Class NodeMetadata

Defines properties and message types for Node.

Property Types

See also PropertyType
NodeMetadata.NameProperty

Node name.

NodeMetadata.PathProperty

Full path to the node.

NodeMetadata.LocaleProperty

The locale of the node.

NodeMetadata.WidthProperty

The width of the node when used in a layout. Overrides the default bounds of the item.

NodeMetadata.HeightProperty

The height of the node when used in a layout. Overrides the default bounds of the item.

NodeMetadata.DepthProperty

The size of the node in depth direction when used in a layout. Overrides the default bounds of the item.

NodeMetadata.ActualWidthProperty

The calculated width of the node when used in a layout.

NodeMetadata.ActualHeightProperty

The calculated height of the node when used in a layout.

NodeMetadata.ActualDepthProperty

The calculated size of the node in depth direction when used in a layout.

NodeMetadata.HorizontalAlignmentProperty

The alignment in horizontal direction the node should use when it resides under a layout.

NodeMetadata.VerticalAlignmentProperty

The alignment in vertical direction the node should use when it resides under a layout.

NodeMetadata.DepthAlignmentProperty

The alignment in depth direction the node should use when it resides under a layout.

NodeMetadata.HorizontalMarginProperty

Sets the horizontal space between this node and other nodes that are adjacent to this node in a layout.

To access the Horizontal Margin property fields in a binding, use:

  • X for the Left property field
  • Y for the Right property field
NodeMetadata.VerticalMarginProperty

Sets the vertical space between this node and other nodes that are adjacent to this node in a layout.

To access the Vertical Margin property fields in a binding, use:

  • X for the Bottom property field
  • Y for the Top property field
NodeMetadata.DepthMarginProperty

Sets the depth distance between this node and other nodes that are adjacent to this node in a layout.

To access the Depth Margin property fields in a binding, use:

  • X for the Back property field
  • Y for the Front property field
NodeMetadata.HitTestableProperty

When enabled, the node can be hit tested. Enabling Hit Testable for a 2D node enables hit testing only for that node. Enabling Hit Testable for a 3D node enables hit testing also for the child nodes. Kanzi hit tests 3D nodes using the default Camera node or the Hit Test Camera node of the active Scene node.

NodeMetadata.HitTestableContainerProperty

When enabled, Kanzi uses the layout bounds as geometry for hit testing.

NodeMetadata.VisibleProperty

When disabled, Kanzi does not render the node.

NodeMetadata.EnabledProperty

Whether this node is enabled. When you disable this property in a node, that node and its descendant nodes in the same overlay focus scope are effectively disabled. Effectively disabling a node removes that node from the focus chain and cancels all the active input manipulators.Use the Effectively Enabled property to observe whether a node is effectively enabled.

NodeMetadata.EffectivelyEnabledProperty

Indicates whether this node and its ancestor nodes are enabled. Use this property in state managers and bindings to observe whether a node is effectively enabled. To enable or disable a node, use the Enabled property. When a node is effectively disabled:

  • When that node is focused, it receives key input until the focus moves to another node.
  • When that node is not focused, it is not part of the focus chain and does not receive key input.
NodeMetadata.FocusableProperty

Indicates whether the node can receive focus.

NodeMetadata.FocusedProperty

Indicates whether the node has the key focus.

NodeMetadata.FocusStateProperty

Reports the focus state of a node:

  • No focus (0) indicates that the node is not focused. For a focus scope node indicates that none of the nodes in the scope have focus.
  • Logical focus (1) indicates that the node is the logical focus node of an overlay-type focus scope. For a focus scope node indicates that one of the nodes in that scope is the logical focus node.
  • Key focus (2) indicates that the node is the key focus node of the application and receives key input. For a focus scope node indicates that one of the nodes in that scope is the key focus node.

Use this property in state managers and bindings to implement focus states in the UI nodes.

To observe whether a node is the key focus node, you can use the boolean Focus > Focused property.

NodeMetadata.FontFamilyProperty

The font family used to render the text.

NodeMetadata.VisibleAmountInParentProperty

Sets the amount the node is inside its parent. Use the value of this property in shaders to implement fades. Calculated by the parent node.

NodeMetadata.ClipChildrenProperty

Sets whether to clip the child nodes of this node. Kanzi clips the child nodes whose bounding box is completely outside of the bounding box of their parent node. Use this property with layout nodes. The child nodes can use only translation transformation.

NodeMetadata.ContentStretchProperty

Sets how the content that belongs to this node is stretched (as opposed to manipulating the actual node size).

NodeMetadata.OpacityProperty

Opacity of the node.

NodeMetadata.HoverProperty

Indicates whether a node is the foremost hit testable node under the cursor.

NodeMetadata.StyleProperty

Sets a style to the node.

NodeMetadata.StateManagerProperty

Sets the State Manager to the node.

NodeMetadata.Projection2DTo3DScaleProperty

Sets the scale factor to project pixels to 3D size. When scale is 1, then the size of one pixel is one 3D space unit.

NodeMetadata.CreatedFromKZBProperty

Kanzi internally uses this property to distinguish objects like bindings and triggers created in code from objects that are loaded from a kzb file.

Message Types

See also MessageType

Message Arguments

Message arguments classes define message arguments used for different message types. Each class defines a number of property types - arguments - together with getter and setter functions for them.

NodeMetadata.NodeComponentMessageArguments

TargetNameProperty

Sets the name of the node component that receives this message. To send this message to every node component in this node, use an empty string.

Example
local value = arguments:getTargetNameProperty()
arguments:setTargetNameProperty(value)

NodeMetadata.NodeComponentSourceMessageArguments

SourceNameProperty

Name of the node component that sent the message.

Example
local value = arguments:getSourceNameProperty()
arguments:setSourceNameProperty(value)