In this video, we use Godot’s
resource to give our interface a default font and a nicer panel style.In Godot, resources are typically files that you plug into nodes. Textures, sounds, and fonts are all examples of resources.
We looked at several of them in this video: the
resource, the , and the we assigned to the scoreboard’s panel.More precisely, a resource is a data container that Godot loads and reuses efficiently.
Most of your game’s shared data will rely on resources, like the fonts that you reuse throughout your user interface.
Each of the blocks outlined below corresponds to a different kind of resource.
Your computer uses font files to draw text.
These files contain drawings of each text character in a particular image format called vector. It allows the computer to draw text of any size without the text becoming blurry or pixelated.
Common font file extensions are .ttf
(TrueType Font: a
proprietary format by Apple) and .otf
(OpenType Font: an
open format).
To change a text’s font and drawing size, Godot requires you to create a
resource. This resource uses a font file to draw the text and a couple of settings to change the text size, the line size, etc.