Documentation
¶
Overview ¶
Maintains a list of resources, nodes, exported and overridden properties, and built-in scripts associated with a scene. They cannot be modified from a graphics.gd/classdb/SceneState, only accessed. Useful for peeking into what a graphics.gd/classdb/PackedScene contains without instantiating it.
This class cannot be instantiated directly, it is retrieved for a given scene as the result of graphics.gd/classdb/PackedScene.Instance.GetState.
Index ¶
- type Advanced
- type Any
- type Expanded
- type Extension
- type GenEditState
- type ID
- type Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsRefCounted() [1]gd.RefCounted
- func (self Instance) AsSceneState() Instance
- func (self Instance) GetBaseSceneState() Instance
- func (self Instance) GetConnectionBinds(idx int) []any
- func (self Instance) GetConnectionCount() int
- func (self Instance) GetConnectionFlags(idx int) int
- func (self Instance) GetConnectionMethod(idx int) string
- func (self Instance) GetConnectionSignal(idx int) string
- func (self Instance) GetConnectionSource(idx int) string
- func (self Instance) GetConnectionTarget(idx int) string
- func (self Instance) GetConnectionUnbinds(idx int) int
- func (self Instance) GetNodeCount() int
- func (self Instance) GetNodeGroups(idx int) []string
- func (self Instance) GetNodeIndex(idx int) int
- func (self Instance) GetNodeInstance(idx int) PackedScene.Instance
- func (self Instance) GetNodeInstancePlaceholder(idx int) string
- func (self Instance) GetNodeName(idx int) string
- func (self Instance) GetNodeOwnerPath(idx int) string
- func (self Instance) GetNodePath(idx int) string
- func (self Instance) GetNodePropertyCount(idx int) int
- func (self Instance) GetNodePropertyName(idx int, prop_idx int) string
- func (self Instance) GetNodePropertyValue(idx int, prop_idx int) any
- func (self Instance) GetNodeType(idx int) string
- func (self Instance) GetPath() string
- func (self Instance) ID() ID
- func (self Instance) IsNodeInstancePlaceholder(idx int) bool
- 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 Expanded ¶
type Expanded [1]gdclass.SceneState
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]) AsRefCounted ¶
func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted
func (*Extension[T]) AsSceneState ¶
type GenEditState ¶
type GenEditState int //gd:SceneState.GenEditState
const ( // If passed to [graphics.gd/classdb/PackedScene.Instance.Instantiate], blocks edits to the scene state. GenEditStateDisabled GenEditState = 0 // If passed to [graphics.gd/classdb/PackedScene.Instance.Instantiate], provides inherited scene resources to the local scene. // // Note: Only available in editor builds. GenEditStateInstance GenEditState = 1 // If passed to [graphics.gd/classdb/PackedScene.Instance.Instantiate], provides local scene resources to the local scene. Only the main scene should receive the main edit state. // // Note: Only available in editor builds. GenEditStateMain GenEditState = 2 // If passed to [graphics.gd/classdb/PackedScene.Instance.Instantiate], it's similar to [GenEditStateMain], but for the case where the scene is being instantiated to be the base of another one. // // Note: Only available in editor builds. GenEditStateMainInherited GenEditState = 3 )
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.SceneState
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 Get ¶
func Get(peer PackedScene.Instance) Instance
Returns the [SceneState] representing the scene file contents.
func (Instance) AsRefCounted ¶
func (self Instance) AsRefCounted() [1]gd.RefCounted
func (Instance) AsSceneState ¶
func (Instance) GetBaseSceneState ¶
Returns the graphics.gd/classdb/SceneState of the scene that this scene inherits from, or null if it doesn't inherit from any scene.
func (Instance) GetConnectionBinds ¶
Returns the list of bound parameters for the signal at 'idx'.
func (Instance) GetConnectionCount ¶
Returns the number of signal connections in the scene.
The idx argument used to query connection metadata in other get_connection_* methods in the interval [0, get_connection_count() - 1].
func (Instance) GetConnectionFlags ¶
Returns the connection flags for the signal at 'idx'. See [Object.ConnectFlags] constants.
func (Instance) GetConnectionMethod ¶
Returns the method connected to the signal at 'idx'.
func (Instance) GetConnectionSignal ¶
Returns the name of the signal at 'idx'.
func (Instance) GetConnectionSource ¶
Returns the path to the node that owns the signal at 'idx', relative to the root node.
func (Instance) GetConnectionTarget ¶
Returns the path to the node that owns the method connected to the signal at 'idx', relative to the root node.
func (Instance) GetConnectionUnbinds ¶
Returns the number of unbound parameters for the signal at 'idx'.
func (Instance) GetNodeCount ¶
Returns the number of nodes in the scene.
The idx argument used to query node data in other get_node_* methods in the interval [0, get_node_count() - 1].
func (Instance) GetNodeGroups ¶
Returns the list of group names associated with the node at 'idx'.
func (Instance) GetNodeIndex ¶
Returns the node's index, which is its position relative to its siblings. This is only relevant and saved in scenes for cases where new nodes are added to an instantiated or inherited scene among siblings from the base scene. Despite the name, this index is not related to the 'idx' argument used here and in other methods.
func (Instance) GetNodeInstance ¶
func (self Instance) GetNodeInstance(idx int) PackedScene.Instance
Returns a graphics.gd/classdb/PackedScene for the node at 'idx' (i.e. the whole branch starting at this node, with its child nodes and resources), or null if the node is not an instance.
func (Instance) GetNodeInstancePlaceholder ¶
Returns the path to the represented scene file if the node at 'idx' is an graphics.gd/classdb/InstancePlaceholder.
func (Instance) GetNodeName ¶
Returns the name of the node at 'idx'.
func (Instance) GetNodeOwnerPath ¶
Returns the path to the owner of the node at 'idx', relative to the root node.
func (Instance) GetNodePath ¶
Returns the path to the node at 'idx'.
If 'for_parent' is true, returns the path of the 'idx' node's parent instead.
func (Instance) GetNodePropertyCount ¶
Returns the number of exported or overridden properties for the node at 'idx'.
The prop_idx argument used to query node property data in other get_node_property_* methods in the interval [0, get_node_property_count() - 1].
func (Instance) GetNodePropertyName ¶
Returns the name of the property at 'prop_idx' for the node at 'idx'.
func (Instance) GetNodePropertyValue ¶
Returns the value of the property at 'prop_idx' for the node at 'idx'.
func (Instance) GetNodeType ¶
Returns the type of the node at 'idx'.
func (Instance) GetPath ¶
Returns the resource path to the represented graphics.gd/classdb/PackedScene.
func (Instance) IsNodeInstancePlaceholder ¶
Returns true if the node at 'idx' is an graphics.gd/classdb/InstancePlaceholder.