0% found this document useful (0 votes)
17 views3 pages

Classes As Data Types Godot GDScript Tutorial Ep 18 Godot Tutorials

In GDScript, classes are considered reference types or objects. The article discusses how classes can be used as data types in GDScript, with examples showing how to declare a variable as a class type and cast a class instance to a different type. It also introduces the concept of data types in programming and how they describe how data is intended to be used.

Uploaded by

Chris Lewinsky
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views3 pages

Classes As Data Types Godot GDScript Tutorial Ep 18 Godot Tutorials

In GDScript, classes are considered reference types or objects. The article discusses how classes can be used as data types in GDScript, with examples showing how to declare a variable as a class type and cast a class instance to a different type. It also introduces the concept of data types in programming and how they describe how data is intended to be used.

Uploaded by

Chris Lewinsky
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Classes as Data Types | Godot GDScript Tutorial | Ep 18 | Godot Tutorials 5/8/23 4:44 PM

Courses / Introduction-To-Gdscript / Godot-Tutorials-Gdscript-18

Classes as Data Types | Godot GDScript Tutorial


| Ep 18

Classes as Data Types | Godot GDScript Tutorial | Ep 18

PREV EPISODE NEXT EPISODE

Learning Materials

https://godottutorials.com/courses/introduction-to-gdscript/godot-tutorials-gdscript-18 Page 1 of 3
Classes as Data Types | Godot GDScript Tutorial | Ep 18 | Godot Tutorials 5/8/23 4:44 PM

 Article  Resource

Classes as a Data Type


A data type is an attribute of data that tells the compiler or interpreter how the programmer intends to use the data.

In Godot, GDScript classes are reference types (objects).

var example: Node2D = Node2D.new() # variable example is a Node2D data type

You are also able to cast data types:

var example: Node = Node2D.new() as Node # cast Node2D instanced object as Node

Creative Common License

Classes as Data Types | Godot GDScript Tutorial | Ep 18 video & article by Godot Tutorials is licensed under a Creative Commons
Attribution-ShareAlike 4.0 International License .

Spread the love, share this if it helped you!

 SHARE ON TWITTER  SHARE ON FACEBOOK  SHARE ON REDDIT  SHARE WITH EMAIL

Subscribe to my Newsletter
Join our newsletter and get news in your inbox! We hate spam too, you
won't get any from me :)

 Email... SUBSCRIBE

https://godottutorials.com/courses/introduction-to-gdscript/godot-tutorials-gdscript-18 Page 2 of 3
Classes as Data Types | Godot GDScript Tutorial | Ep 18 | Godot Tutorials 5/8/23 4:44 PM

GODOT TUTORIALS
WEBSITE RESOURCES LEGAL OTHER

Courses Godot Privacy Policy Contact Me

Trello Cookie Policy Website Info

Github Terms & About Me


Conditions
  
Disclaimer

©2021 Godot Tutorials | Website Powered by Hugo Framework

https://godottutorials.com/courses/introduction-to-gdscript/godot-tutorials-gdscript-18 Page 3 of 3

You might also like