// Importing library #include#include // Creating spatial node class MyNode : public godot::Spatial { GODOT_CLASS(MyNode, godot::Spatial) public: MyNode() {} ~MyNode() {} void _ready() { // Setting uniform scale of x3 set_scale(Vector3(3, 3, 3)); } }; // Registering node with Godot engine godot::register_class ();
// Importing library #includeThis example sets the non-uniform scale of the newly created node twice in the X-axis and four times in the Y-axis. The method `set_scale()` is an inbuilt function within the Godot API. The package/library used here is Godot, a real-time 2D and 3D game engine with a visual editor.#include // Creating sprite node class MyNode : public godot::Sprite { GODOT_CLASS(MyNode, godot::Sprite) public: MyNode() {} ~MyNode() {} void _ready() { // Setting scale of x2 in X-axis and x4 in Y-axis set_scale(Vector2(2, 4)); } }; // Registering node with Godot engine godot::register_class ();