Documentation
¶
Overview ¶
This node is used to preload sub-resources inside a scene, so when the scene is loaded, all the resources are ready to use and can be retrieved from the preloader. You can add the resources using the ResourcePreloader tab when the node is selected.
GDScript has a simplified [graphics.gd/classdb/@GDScript.Instance.Preload] built-in method which can be used in most situations, leaving the use of graphics.gd/classdb/ResourcePreloader for more advanced scenarios.
Index ¶
- type Advanced
- type Any
- type Extension
- type ID
- type Instance
- func (self Instance) AddResource(name string, resource Resource.Instance)
- func (self Instance) AsNode() Node.Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsResourcePreloader() Instance
- func (self Instance) GetResource(name string) Resource.Instance
- func (self Instance) GetResourceList() []string
- func (self Instance) HasResource(name string) bool
- func (self Instance) ID() ID
- func (self Instance) RemoveResource(name string)
- func (self Instance) RenameResource(name string, newname string)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) Virtual(name string) reflect.Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advanced ¶
type Advanced = class
Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.
type Extension ¶
Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension
func (*Extension[T]) AsResourcePreloader ¶
type ID ¶
ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.
type Instance ¶
type Instance [1]gdclass.ResourcePreloader
Instance of the class with convieniently typed arguments and results.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AddResource ¶
Adds a resource to the preloader with the given 'name'. If a resource with the given 'name' already exists, the new resource will be renamed to "'name' N" where N is an incrementing number starting from 2.
func (Instance) AsResourcePreloader ¶
func (Instance) GetResource ¶
Returns the resource associated to 'name'.
func (Instance) GetResourceList ¶
Returns the list of resources inside the preloader.
func (Instance) HasResource ¶
Returns true if the preloader contains a resource associated to 'name'.
func (Instance) RemoveResource ¶
Removes the resource associated to 'name' from the preloader.
func (Instance) RenameResource ¶
Renames a resource inside the preloader from 'name' to 'newname'.