module Godot::PreloadCache

Overview

In-memory thread-safe cache for preloaded resources

Defined in:

libgodot/extensions/resource.cr

Class Method Summary

Class Method Detail

def self.[]=(path : String, resource : Resource) : Void #

Directly inserts or overrides a resource in the preloaded cache


def self.clear : Void #

def self.delete(path : String) : Resource | Nil #

Removes a cached resource from memory, returning it if present


def self.get_or_load(path : String, type : T.class) : T forall T #

def self.get_or_load?(path : String, type : T.class) : T | Nil forall T #

def self.has?(path : String) : Bool #

def self.set(path : String, resource : Resource) : Void #

Directly inserts or overrides a resource in the preloaded cache


def self.size : Int32 #

Returns the count of resources currently cached in memory