Class Node_GD_CB_Extension
- Namespace
- Godot
- Assembly
- com.cobilas.godot.utility.dll
Extension for Godot.Node class.
public static class Node_GD_CB_Extension
- Inheritance
-
Node_GD_CB_Extension
- Inherited Members
Methods
ContainsNode(Node, Node)
Allows you to check whether a given Godot.Node object is a child.
public static bool ContainsNode(this Node origin, Node node)
Parameters
originNodeThe target object.
nodeNodeThe Godot.Node to be compared.
Returns
- bool
Returns
truewhen the target object contains the comparison object.
Duplicate<T>(Node, int)
Duplicates the node, returning a new node.
You can fine-tune the behavior using the flags (see Godot.Node.DuplicateFlags).
Note: It will not work properly if the node contains a script with constructor arguments (i.e. needs to supply arguments to method). In that case, the node will be duplicated without a script.
public static T Duplicate<T>(this Node node, int flags = 15) where T : Node
Parameters
nodeNodeflagsint
Returns
- T
Type Parameters
T
FindNodeByName(Node, string)
Get a node from name.
By default, the method looks for a node of type node.(Type typeNode = typeof(Godot.Node))
By default, the method searches recursively.(bool recusive = true)
public static Node FindNodeByName(this Node N, string name)
Parameters
NNodeThe Godot.Node that will be used.
namestringThe node name
Returns
- Node
FindNodeByName(Node, string, bool)
Get a node from name.
By default, the method looks for a node of type node.(Type typeNode = typeof(Godot.Node))
public static Node FindNodeByName(this Node N, string name, bool recusive)
Parameters
NNodeThe Godot.Node that will be used.
namestringThe node name
recusiveboolAlso look for your children.
Returns
- Node
FindNodeByName(Node, string, Type, bool)
Get a node from name.
public static Node FindNodeByName(this Node N, string name, Type typeNode, bool recusive)
Parameters
NNodeThe Godot.Node that will be used.
namestringThe node name
typeNodeTypeThe type to look for.
recusiveboolAlso look for your children.
Returns
- Node
The method returns the object based on its name, if not found the method returns NullNode.
FindNodeByName<T>(Node, string)
Get a node from name.
By default, the method searches recursively.(bool recusive = true)
public static T FindNodeByName<T>(this Node N, string name) where T : Node
Parameters
NNodeThe Godot.Node that will be used.
namestringThe node name
Returns
- T
Type Parameters
T
FindNodeByName<T>(Node, string, bool)
Get a node from name.
public static T FindNodeByName<T>(this Node N, string name, bool recusive) where T : Node
Parameters
NNodeThe Godot.Node that will be used.
namestringThe node name
recusiveboolAlso look for your children.
Returns
- T
Type Parameters
TThe type to look for.
FindNodes(Node, Type)
Get the nodes from a type.
By default, the method searches recursively.(bool recusive = true)
public static Node[] FindNodes(this Node N, Type typeNode)
Parameters
NNodeThe Godot.Node that will be used.
typeNodeTypeThe type to look for.
Returns
- Node[]
Returns a list of nodes.
FindNodes(Node, Type, bool)
Get the nodes from a type.
public static Node[] FindNodes(this Node N, Type typeNode, bool recusive)
Parameters
NNodeThe Godot.Node that will be used.
typeNodeTypeThe type to look for.
recusiveboolAlso look for your children.
Returns
- Node[]
Returns a list of nodes.
FindNodes<T>(Node)
Get the nodes from a type.
By default, the method searches recursively.(bool recusive = true)
public static T[] FindNodes<T>(this Node N) where T : Node
Parameters
NNode
Returns
- T[]
Returns a list of nodes.
Type Parameters
TThe type to look for.
FindNodes<T>(Node, bool)
Get the nodes from a type.
public static T[] FindNodes<T>(this Node N, bool recusive) where T : Node
Parameters
NNodeThe Godot.Node that will be used.
recusiveboolAlso look for your children.
Returns
- T[]
Returns a list of nodes.
Type Parameters
TThe type to look for.
GetNodePosition(Node)
Obtem a posição atual do objeto Godot.Node.
This method will only take effect when the Godot.Node object inherits the Godot.Node2D class or the Godot.Spatial class.
public static Vector3D GetNodePosition(this Node N)
Parameters
NNodeThe Godot.Node that will be used.
Returns
GetNodeRotation(Node)
Gets the current rotation of the Godot.Node object.
This method will only take effect when the Godot.Node object inherits the Godot.Node2D class or the Godot.Spatial class.
public static Vector3D GetNodeRotation(this Node N)
Parameters
NNodeThe Godot.Node that will be used.
Returns
GetNodeScale(Node)
Gets the current scale of the Godot.Node object.
This method will only take effect when the Godot.Node object inherits the Godot.Node2D class or the Godot.Spatial class.
public static Vector3D GetNodeScale(this Node N)
Parameters
NNodeThe Godot.Node that will be used.
Returns
- Vector3D
Returns a Vector3D containing the current scale of the Node object.
SetNodePosition(Node, Vector3D)
Allows you to define the position of the Godot.Node object.
This method will only take effect when the Godot.Node object inherits the Godot.Node2D class or the Godot.Spatial class.
public static void SetNodePosition(this Node N, Vector3D position)
Parameters
NNodeThe Godot.Node that will be used.
positionVector3DThe new position of the Godot.Node object.
SetNodeRotation(Node, Vector3D)
Allows you to define the rotation of the Godot.Node object.
This method will only take effect when the Godot.Node object inherits the Godot.Node2D class or the Godot.Spatial class.
public static void SetNodeRotation(this Node N, Vector3D rotation)
Parameters
NNodeThe Godot.Node that will be used.
rotationVector3DThe new rotation of the Godot.Node object.
SetNodeScale(Node, Vector3D)
Allows you to define the scale of the Godot.Node object.
This method will only take effect when the Godot.Node object inherits the Godot.Node2D class or the Godot.Spatial class.
public static void SetNodeScale(this Node N, Vector3D scale)
Parameters
NNodeThe Godot.Node that will be used.
scaleVector3DThe new size or scale of the Godot.Node object.
SetParent(Node?, Node?)
The method allows you to change the object's parent.
public static void SetParent(this Node? p, Node? parent)
Parameters
pNodeThe target object.
parentNodeThe object that will be the parent of the target object.
Exceptions
- ArgumentNullException
Occurs when the target object parameter is passed as null.