JenovaSDK API Reference
Developed by Hamid.Memar (MemarDesign™ LLC.)
 
Loading...
Searching...
No Matches
Template Functions

Functions

template<typename T>
T * GetSelf (Caller *caller)
 Returns a pointer to the current Node instance the C++ script is executing from.
 
template<typename T>
T * GetNode (const godot::String &nodePath)
 Returns a pointer to a node by its path. Wrapper for GetNodeByPath().
 
template<typename T>
T * FindNode (godot::Node *parent, const godot::String &nodeName)
 Finds a node by its name in a given parent node. Wrapper for FindNodeByName().
 
template<typename T>
T * GlobalPointer (MemoryID id)
 Returns a global pointer. Wrapper for GetGlobalPointer().
 
template<typename T>
GlobalGet (MemoryID id)
 Returns the value of a global pointer.
 
template<typename T>
void GlobalSet (MemoryID id, const T &newValue)
 Sets the value of a global pointer.
 
template<typename T>
GlobalVariable (VariableID id)
 Returns the value of a global variable. Wrapper for GetGlobalVariable().
 
template<typename T>
T * GetObjectFromIntPtr (IntPtr ptr)
 Returns a pointer to an object from an IntPtr.
 
template<typename T>
T * GetObjectFromIntPtr (godot::Variant variantPtr)
 Returns a pointer to an object from a Variant IntPtr.
 

Detailed Description

A collection of template functions providing a set of utilities for accessing and managing nodes and variables within the engine, including node retrieval, node searching, global pointer management and global variable access.

Function Documentation

◆ GetSelf()

template<typename T>
T * GetSelf ( Caller * caller)

Returns a pointer to the current Node instance the C++ script is executing from.

Template Parameters
TThe type of the Node class.
Parameters
callerA pointer to the caller instance.
Returns
A casted pointer to the current Node instance.

◆ GetNode()

template<typename T>
T * GetNode ( const godot::String & nodePath)

Returns a pointer to a node by its path. Wrapper for GetNodeByPath().

Template Parameters
TThe type of the node.
Parameters
nodePathThe path to the node.
Returns
A casted pointer to the node, or nullptr if not found.

◆ FindNode()

template<typename T>
T * FindNode ( godot::Node * parent,
const godot::String & nodeName )

Finds a node by its name in a given parent node. Wrapper for FindNodeByName().

Template Parameters
TThe type of the node.
Parameters
parentThe parent node to search in.
nodeNameThe name of the node to find.
Returns
A casted pointer to the node, or nullptr if not found.

◆ GlobalPointer()

template<typename T>
T * GlobalPointer ( MemoryID id)

Returns a global pointer. Wrapper for GetGlobalPointer().

Template Parameters
TThe type of the global pointer.
Parameters
idThe Unique ID of the global pointer.
Returns
A casted pointer to the global memory, or nullptr if not found.

◆ GlobalGet()

template<typename T>
T GlobalGet ( MemoryID id)

Returns the value of a global pointer.

Template Parameters
TThe type of the global pointer.
Parameters
idThe Unique ID of the global pointer.
Returns
The casted value of the global pointer.

◆ GlobalSet()

template<typename T>
void GlobalSet ( MemoryID id,
const T & newValue )

Sets the value of a global pointer.

Template Parameters
TThe type of the global pointer.
Parameters
idThe Unique ID of the global pointer.
newValueThe new value to set.

◆ GlobalVariable()

template<typename T>
T GlobalVariable ( VariableID id)

Returns the value of a global variable. Wrapper for GetGlobalVariable().

Template Parameters
TThe type of the variable.
Parameters
idThe Unique ID of the variable.
Returns
The casted value of the variable.

◆ GetObjectFromIntPtr() [1/2]

template<typename T>
T * GetObjectFromIntPtr ( IntPtr ptr)

Returns a pointer to an object from an IntPtr.

Template Parameters
TThe type of the object.
Parameters
ptrThe IntPtr to the object.
Returns
A casted pointer to the object, or nullptr if not found.

◆ GetObjectFromIntPtr() [2/2]

template<typename T>
T * GetObjectFromIntPtr ( godot::Variant variantPtr)

Returns a pointer to an object from a Variant IntPtr.

Template Parameters
TThe type of the object.
Parameters
variantPtrThe Variant containing pointer to the object.
Returns
A casted pointer to the object, or nullptr if not found.