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 ¶
- type Advanced
- type Any
- type Extension
- type ID
- type Instance
- func (self Instance) AddNode(node Node.Instance)
- func (self Instance) AsEditorSelection() Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) Clear()
- func (self Instance) GetSelectedNodes() []Node.Instance
- func (self Instance) GetTopSelectedNodes() []Node.Instance
- func (self Instance) GetTransformableSelectedNodes() []Node.Instance
- func (self Instance) ID() ID
- func (self Instance) OnSelectionChanged(cb func(), flags ...Signal.Flags)
- func (self Instance) RemoveNode(node Node.Instance)
- 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]) AsEditorSelection ¶
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.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 (Instance) AddNode ¶
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 (Instance) GetSelectedNodes ¶
Returns the list of selected nodes.
func (Instance) GetTopSelectedNodes ¶
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 ¶
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) OnSelectionChanged ¶
func (Instance) RemoveNode ¶
Removes a node from the selection.