Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What are Nodes?
#1
Did you know that Godot Nodes make use of OOP? This is Object Oriented programming where each Node extends functionality of a less powerful Node.

The most simple Node is called Node and does not even have a position value, this property gets added by extending it to Node2D for example. The most complicated nodes are found at the ends of the tree such as the FileDialog Control Node. These Nodes inherit all of the Properties, Methods, and Signals of their ancestor nodes.

Properties are like variables that are set to customize a Node instance. The settings of these properties get remembered when you save a scene.

When you create a Scene, it is like creating your own custom Node that you can instance in other scenes. In fact, you may give your scene a class_name so that it gets added to the scene tree in the Editor. Using export vars, you are able to create additional properties for your scene to show up in the Inspector and get saved with the scene.

The Methods are functions that the Node provides and you may add additional functions to your scene that Extends the base Node that you started with.

The Signals are used for the purpose of loosely coupling your scene to the other parts of your game. Nodes emit signals, and any place that is connected to it gets to run a function in response. The idea of loose coupling means that your scene should still run on its own without errors, it doesn't know what is interested in its signals. And you may add your own custom signals.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)