class

SpritesheetAtlas

Inherits Godot::Resource < Godot::RefCounted < Godot::Object < Reference < Object

Custom Godot Resource representing a packed SVG texture atlas spritesheet and providing O(1) lookup of frame indices, grid coordinates, and UV rects by String or Char keys.

Constructors

new

Class methods

_godot_has_virtual_method(method_name : String) : Bool
_godot_register_node_class
derive_key(id : String, strip_prefix : String) : String

Derives the canonical short key from a raw SVG basename id and strip_prefix.

Source
godot_class_name
godot_parent_class_name

Instance methods

[](key : String | Char) : Int32

Looks up the 0-based sprite frame index for key (String or Char), raising KeyError if not found.

Source
[](key : Symbol) : Int32

Looks up the 0-based sprite frame index for key (Symbol), raising KeyError if not found.

Source
[]?(key : String | Char) : Int32 | Nil

Looks up the 0-based sprite frame index for key (String or Char), or returns nil if not found.

Source
[]?(key : Symbol) : Int32 | Nil

Looks up the 0-based sprite frame index for key (Symbol), or returns nil if not found.

Source
_godot_call_tool_button(button_name : String) : Void

Dispatches inspector tool button clicks on this object.

_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).

_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.

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

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

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

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

aliases
Source
apply_to(material : ShaderMaterial, key : String | Char | Symbol) : Int32

Applies this atlas's base_texture, hframes, vframes, and the resolved frame for key onto a ShaderMaterial (such as one using pattern_replace.gdshader).

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.

cell_px_size
Source
cell_px_size=(cell_px_size : Int64)
Source
cell_size

Padded viewBox size of a single cell (icon_size + padding * 2).

Source
columns
Source
columns=(columns : Int64)
Source
configure(atlas_name : String, source_dir : String, texture_path : String, resource_path : String = "", strip_prefix : String = "", columns : Int32 = 12, rows : Int32 = 1, icon_size : Int32 = 640, padding : Int32 = 64, cell_px_size : Int32 = 0, item_ids : Array(String) = [] of String, aliases : Hash(String, String) | Nil = nil) : self

Configures all atlas metadata in a single call and rebuilds lookup caches.

Source
count
Source
count=(count : Int64)
Source
effective_cell_px_size

Rendered pixel width/height per cell on the final SVG spritesheet.

Source
entries

Returns ItemInfo for all items in the atlas in frame order.

Source
has?(key : String | Char | Symbol) : Bool

Returns true if key exists in this spritesheet atlas.

Source
hframes

Number of horizontal columns (hframes uniform in pattern_replace.gdshader).

Source
icon_size
Source
icon_size=(icon_size : Int64)
Source
id_at(index : Int) : String

Returns the raw SVG basename ID at 0-based index.

Source
id_at?(index : Int) : String | Nil
Source
info(key : String | Char | Symbol) : ItemInfo

Returns full ItemInfo metadata for key (String, Char, or Symbol), raising KeyError if not found.

Source
info?(key : String | Char | Symbol) : ItemInfo | Nil

Returns full ItemInfo metadata for key (String, Char, or Symbol), or nil if not found.

Source
info_at(index : Int) : ItemInfo

Returns full ItemInfo metadata for the 0-based frame index, raising IndexError if out of bounds.

Source
info_at?(index : Int) : ItemInfo | Nil

Returns full ItemInfo metadata for the 0-based frame index, or nil if out of bounds.

Source
item_ids

Ordered array of raw SVG basenames (without .svg extension).

Source
item_ids=(ids : Array(String)) : Array(String)
Source
item_ids_csv
Source
item_ids_csv=(item_ids_csv : String)
Source
item_keys

Ordered array of canonical short keys corresponding to item_ids.

Source
item_keys=(keys : Array(String)) : Array(String)
Source
item_keys_csv
Source
item_keys_csv=(item_keys_csv : String)
Source
key_at(index : Int) : String

Returns the canonical short key at 0-based index.

Source
key_at?(index : Int) : String | Nil
Source
keys
Source
normalize_key(key : String | Char) : String

Normalizes a lookup key (String or Char) into a canonical lowercase hyphenated string.

Source
padding
Source
padding=(padding : Int64)
Source
register_alias(from_key : String, to_key : String) : Void

Registers a key alias (e.g. "happy" => "smile").

Source
resource_path

Returns the .tres resource path for this atlas, falling back to Resource#get_path when backed by Godot.

Source
resource_path=(val : String)

Sets the .tres resource path for this atlas without colliding with Resource's built-in resource_path member in ClassDB.

Source
rows
Source
rows=(rows : Int64)
Source
size

Total number of items in the spritesheet.

Source
source_dir
Source
source_dir=(source_dir : String)
Source
strip_prefix
Source
strip_prefix=(strip_prefix : String)
Source
texture

Preloads and returns the Godot Texture2D for texture_path when running inside Godot.

Source
texture_path
Source
texture_path=(texture_path : String)
Source
vframes

Number of vertical rows (vframes uniform in pattern_replace.gdshader).

Source

Macros

autoload(*args, **kwargs)

DSL directives for in-body autoload configuration

autoload_node(*args, **kwargs)
build
create

Nested types