ResourcePreloader

package
v0.0.0-...-a7442fb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 13, 2025 License: MIT Imports: 24 Imported by: 0

Documentation

Overview

Package ResourcePreloader provides methods for working with ResourcePreloader object instances.

Index

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 Any

type Any interface {
	gd.IsClass
	AsResourcePreloader() Instance
}

type Extension

type Extension[T gdclass.Interface] struct{ gdclass.Extension[T, Instance] }

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]) AsNode

func (self *Extension[T]) AsNode() Node.Instance

func (*Extension[T]) AsObject

func (self *Extension[T]) AsObject() [1]gd.Object

func (*Extension[T]) AsResourcePreloader

func (self *Extension[T]) AsResourcePreloader() Instance

type ID

type ID Object.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.

func (ID) Instance

func (id ID) Instance() (Instance, bool)

type Instance

type Instance [1]gdclass.ResourcePreloader

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 [method @GDScript.preload] built-in method which can be used in most situations, leaving the use of [ResourcePreloader] for more advanced scenarios.

var Nil Instance

Nil is a nil/null instance of the class. Equivalent to the zero value.

func New

func New() Instance

func (Instance) AddResource

func (self Instance) AddResource(name string, resource Resource.Instance)

Adds a resource to the preloader with the given [param name]. If a resource with the given [param name] already exists, the new resource will be renamed to "[param name] N" where N is an incrementing number starting from 2.

func (Instance) AsNode

func (self Instance) AsNode() Node.Instance

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) AsResourcePreloader

func (self Instance) AsResourcePreloader() Instance

func (Instance) GetResource

func (self Instance) GetResource(name string) Resource.Instance

Returns the resource associated to [param name].

func (Instance) GetResourceList

func (self Instance) GetResourceList() []string

Returns the list of resources inside the preloader.

func (Instance) HasResource

func (self Instance) HasResource(name string) bool

Returns [code]true[/code] if the preloader contains a resource associated to [param name].

func (Instance) ID

func (self Instance) ID() ID

func (Instance) RemoveResource

func (self Instance) RemoveResource(name string)

Removes the resource associated to [param name] from the preloader.

func (Instance) RenameResource

func (self Instance) RenameResource(name string, newname string)

Renames a resource inside the preloader from [param name] to [param newname].

func (*Instance) SetObject

func (self *Instance) SetObject(obj [1]gd.Object) bool

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL