class

SvgSpritesheetBuilder

Inherits Godot::Node < Godot::Object < Reference < Object

Standardized in-editor tool node and builder for packing a directory of FontAwesome duotone SVGs into a padded grid .svg texture atlas and generating its corresponding .tres SpritesheetAtlas resource.

Constants

DEFAULT_CELL_PX_SIZE = 0
DEFAULT_COLUMNS = 12
DEFAULT_ICON_SIZE = 640
DEFAULT_PADDING = 64
FACES_CONFIG = Config.new(name: Faces::ATLAS_NAME, title: "Faces", source_dir: Faces::SOURCE_DIR, output_path: Faces::TEXTURE_PATH, resource_path: Faces::RESOURCE_PATH, strip_prefix: Faces::STRIP_PREFIX, columns: Faces::DEFAULT_COLS, icon_size: Faces::ICON_SIZE, padding: Faces::PADDING, cell_px_size: Faces::CELL_PX_SIZE, aliases: Faces::ALIASES)
LETTER_GLYPHS_CONFIG = Config.new(name: Glyphs::ATLAS_NAME, title: "Letter Glyphs", source_dir: Glyphs::SOURCE_DIR, output_path: Glyphs::TEXTURE_PATH, resource_path: Glyphs::RESOURCE_PATH, strip_prefix: Glyphs::STRIP_PREFIX, columns: Glyphs::DEFAULT_COLS, icon_size: Glyphs::ICON_SIZE, padding: Glyphs::PADDING, cell_px_size: Glyphs::CELL_PX_SIZE)
PRESETS = [FACES_CONFIG, LETTER_GLYPHS_CONFIG]

Constructors

Class methods

_godot_has_virtual_method(method_name : String) : Bool
Source
_godot_register_node_class
Source
ensure_lossless_svg_import(resolved_svg_path : String, res_svg_path : String) : Void

Ensures <output_svg>.import exists with lossless compression (compress/mode=0, detect_3d/compress_to=0) so Godot does not apply lossy VRAM compression to the SVG spritesheet.

Source
extract_paths(svg_content : String) : Array(String)

Extracts all <path .../> elements from a normalized SVG string.

Source
generate(source_dir : String, output_path : String, resource_path : String = "", strip_prefix : String = "", atlas_name : String = "", title : String = "", columns : Int32 = DEFAULT_COLUMNS, icon_size : Int32 = DEFAULT_ICON_SIZE, padding : Int32 = DEFAULT_PADDING, cell_px_size : Int32 = DEFAULT_CELL_PX_SIZE, aliases : Hash(String, String) = Hash(String, String).new) : Result

Scans source_dir for all .svg files, normalizes each file in-place if needed, writes the combined padded spritesheet to output_path, and writes the .tres SpritesheetAtlas resource to resource_path when provided.

Source
generate(config : Config) : Result

Generates a combined SVG spritesheet and .tres SpritesheetAtlas resource from a Config.

Source
generate_all

Generates all registered preset spritesheets (FACES_CONFIG and LETTER_GLYPHS_CONFIG).

Source
godot_class_name
Source
godot_parent_class_name
Source
normalize_svg(svg_content : String) : String

Normalizes a single FontAwesome SVG string so that any <path> with opacity (transparent secondary duotone layer) has its opacity removed and its fill changed to solid white (#ffffff), while keeping primary black paths (fill="currentColor") black.

Source
resolve_filesystem_path(path : String) : String
Source
to_res_path(path : String) : String
Source
write_tres_resource(resolved_tres_path : String, atlas : SpritesheetAtlas) : Void

Writes a Godot 4 .tres resource file for SpritesheetAtlas.

Source

Instance methods

_godot_call_tool_button(button_name : String) : Void

Dispatches inspector tool button clicks on this object.

Source
_godot_call_virtual(method_name : String, delta : Float64) : Void

Virtual method and property dispatch hooks overridden by class registration macros. Delta timestep is received with 64-bit precision (Float64).

Source
_godot_call_virtual_with_data(method_name : String, args : Pointer(Pointer(Void)), ret : Pointer(Void)) : Void

Dispatches generic virtual methods with raw arguments and return buffer.

Source
_godot_get_property(prop_name : String, ret_ptr : Pointer(Void)) : Void

Invoked by the GDExtension bridge when retrieving an exposed @export property.

Source
_godot_set_property(prop_name : String, val_ptr : Pointer(Void)) : Void

Invoked by the GDExtension bridge when setting an exposed @export property.

Source
atlas_name
Source
atlas_name=(atlas_name : String)
Source
call(method : String, *args) : Pointer(Void)

Calls the named method on the object with variable arguments.

Source
cell_px_size
Source
cell_px_size=(cell_px_size : Int64)
Source
columns
Source
columns=(columns : Int64)
Source
icon_size
Source
icon_size=(icon_size : Int64)
Source
output_path
Source
output_path=(output_path : String)
Source
padding
Source
padding=(padding : Int64)
Source
rebuild_all_spritesheets
Source
rebuild_spritesheet
Source
resource_path
Source
resource_path=(resource_path : String)
Source
source_dir
Source
source_dir=(source_dir : String)
Source
strip_prefix
Source
strip_prefix=(strip_prefix : String)
Source

Macros

autoload(*args, **kwargs)

DSL directives for in-body autoload configuration

Source
autoload_node(*args, **kwargs)
Source
build
Source
create
Source

Nested types