SceneState

package
v0.0.0-...-ff35923 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2025 License: MIT Imports: 23 Imported by: 0

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

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
	AsSceneState() Instance
}

type Expanded

type Expanded [1]gdclass.SceneState

func (Expanded) GetNodePath

func (self Expanded) GetNodePath(idx int, for_parent bool) string

Returns the path to the node at 'idx'.

If 'for_parent' is true, returns the path of the 'idx' node's parent instead.

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

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

func (*Extension[T]) AsRefCounted

func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted

func (*Extension[T]) AsSceneState

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

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

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

func New() Instance

func (Instance) AsObject

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

func (Instance) AsRefCounted

func (self Instance) AsRefCounted() [1]gd.RefCounted

func (Instance) AsSceneState

func (self Instance) AsSceneState() Instance

func (Instance) GetBaseSceneState

func (self Instance) GetBaseSceneState() Instance

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

func (self Instance) GetConnectionBinds(idx int) []any

Returns the list of bound parameters for the signal at 'idx'.

func (Instance) GetConnectionCount

func (self Instance) GetConnectionCount() int

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

func (self Instance) GetConnectionFlags(idx int) int

Returns the connection flags for the signal at 'idx'. See [Object.ConnectFlags] constants.

func (Instance) GetConnectionMethod

func (self Instance) GetConnectionMethod(idx int) string

Returns the method connected to the signal at 'idx'.

func (Instance) GetConnectionSignal

func (self Instance) GetConnectionSignal(idx int) string

Returns the name of the signal at 'idx'.

func (Instance) GetConnectionSource

func (self Instance) GetConnectionSource(idx int) string

Returns the path to the node that owns the signal at 'idx', relative to the root node.

func (Instance) GetConnectionTarget

func (self Instance) GetConnectionTarget(idx int) string

Returns the path to the node that owns the method connected to the signal at 'idx', relative to the root node.

func (Instance) GetConnectionUnbinds

func (self Instance) GetConnectionUnbinds(idx int) int

Returns the number of unbound parameters for the signal at 'idx'.

func (Instance) GetNodeCount

func (self Instance) GetNodeCount() int

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

func (self Instance) GetNodeGroups(idx int) []string

Returns the list of group names associated with the node at 'idx'.

func (Instance) GetNodeIndex

func (self Instance) GetNodeIndex(idx int) int

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

func (self Instance) GetNodeInstancePlaceholder(idx int) string

Returns the path to the represented scene file if the node at 'idx' is an graphics.gd/classdb/InstancePlaceholder.

func (Instance) GetNodeName

func (self Instance) GetNodeName(idx int) string

Returns the name of the node at 'idx'.

func (Instance) GetNodeOwnerPath

func (self Instance) GetNodeOwnerPath(idx int) string

Returns the path to the owner of the node at 'idx', relative to the root node.

func (Instance) GetNodePath

func (self Instance) GetNodePath(idx int) string

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

func (self Instance) GetNodePropertyCount(idx int) int

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

func (self Instance) GetNodePropertyName(idx int, prop_idx int) string

Returns the name of the property at 'prop_idx' for the node at 'idx'.

func (Instance) GetNodePropertyValue

func (self Instance) GetNodePropertyValue(idx int, prop_idx int) any

Returns the value of the property at 'prop_idx' for the node at 'idx'.

func (Instance) GetNodeType

func (self Instance) GetNodeType(idx int) string

Returns the type of the node at 'idx'.

func (Instance) GetPath

func (self Instance) GetPath() string

Returns the resource path to the represented graphics.gd/classdb/PackedScene.

func (Instance) ID

func (self Instance) ID() ID

func (Instance) IsNodeInstancePlaceholder

func (self Instance) IsNodeInstancePlaceholder(idx int) bool

Returns true if the node at 'idx' is an graphics.gd/classdb/InstancePlaceholder.

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