@TheShaggyDev
  @TheShaggyDev
The Shaggy Dev | Static typing in Godot using the class_name keyword @TheShaggyDev | Uploaded October 2021 | Updated October 2024, 2 hours ago.
In this video, we'll look at how you can use the class_name keyword to enable static typing for your custom classes. We'll also look at some other uses for it, such as subclassing, and the common pain points people run into when using it (cyclic dependency anyone?)

Source code: github.com/theshaggydev/the-shaggy-dev-projects/tree/main/projects/godot-3/class-name-introduction

Text version of this tutorial: shaggydev.com/2021/10/19/godot-class-name

Artwork provided by Kenney: kenney.nl


Intro: 00:00
Base usage: 00:29
Other uses: 01:18
Gotcha #1 - The global namespace 01:59
Gotcha #2 - Cyclic dependencies 02:52
Static typing in Godot using the class_name keywordAn introduction to graph rewriting for procedural content generationGodot 4 lambda functionsConfiguring your Godot project for pixel artUsing the AStarGrid2D class in Godot 4How I do screen shake in GodotCustom cursors in GodotMaking a customizable turn-based combat game in two weeksCommunicating between game objects with the observer patternSetter and getter functions in Godot 3 with setgetHow unit selection works in my tactical strategy gameCreating volume sliders in Godot 4

Static typing in Godot using the class_name keyword @TheShaggyDev

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER