EditorSelection

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

This object manages the SceneTree selection in the editor.

Note: This class shouldn't be instantiated directly. Instead, access the singleton using graphics.gd/classdb/EditorInterface.GetSelection.

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
	AsEditorSelection() 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]) AsEditorSelection

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

func (*Extension[T]) AsObject

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

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

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 New

func New() Instance

func (Instance) AddNode

func (self Instance) AddNode(node Node.Instance)

Adds a node to the selection.

Note: The newly selected node will not be automatically edited in the inspector. If you want to edit a node, use graphics.gd/classdb/EditorInterface.EditNode.

func (Instance) AsEditorSelection

func (self Instance) AsEditorSelection() Instance

func (Instance) AsObject

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

func (Instance) Clear

func (self Instance) Clear()

Clear the selection.

func (Instance) GetSelectedNodes

func (self Instance) GetSelectedNodes() []Node.Instance

Returns the list of selected nodes.

func (Instance) GetTopSelectedNodes

func (self Instance) GetTopSelectedNodes() []Node.Instance

Returns the list of top selected nodes only, excluding any children. This is useful for performing transform operations (moving them, rotating, etc.).

For example, if there is a node A with a child B and a sibling C, then selecting all three will cause this method to return only A and C. Changing the global transform of A will affect the global transform of B, so there is no need to change B separately.

func (Instance) GetTransformableSelectedNodes

func (self Instance) GetTransformableSelectedNodes() []Node.Instance

Returns the list of top selected nodes only, excluding any children. This is useful for performing transform operations (moving them, rotating, etc.). See Instance.GetTopSelectedNodes.

func (Instance) ID

func (self Instance) ID() ID

func (Instance) OnSelectionChanged

func (self Instance) OnSelectionChanged(cb func(), flags ...Signal.Flags)

func (Instance) RemoveNode

func (self Instance) RemoveNode(node Node.Instance)

Removes a node from the selection.

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