Inheritance #
- AudioServer
- CameraServer
- ClassDB
- DisplayServer
- EditorFileSystemDirectory
- EditorInterface
- EditorPaths
- EditorSelection
- EditorUndoRedoManager
- EditorVCSInterface
- Engine
- EngineDebugger
- FramebufferCacheRD
- GDExtensionManager
- Geometry2D
- Geometry3D
- IP
- Input
- InputMap
- JNISingleton
- JSONRPC
- JavaClassWrapper
- JavaScriptBridge
- MainLoop (1)
- Marshalls
- MovieWriter
- NativeMenu
- NavigationMeshGenerator
- NavigationServer2D
- NavigationServer3D
- Node (21)
- OS
- OpenXRExtensionWrapperExtension
- OpenXRInteractionProfileMetadata
- Performance
- PhysicsDirectBodyState2D (1)
- PhysicsDirectBodyState3D (1)
- PhysicsDirectSpaceState2D (1)
- PhysicsDirectSpaceState3D (1)
- PhysicsServer2D (1)
- PhysicsServer2DManager
- PhysicsServer3D (1)
- PhysicsServer3DManager
- PhysicsServer3DRendering
ServerHandler
- ProjectSettings
- RefCounted (121)
- RenderData (2)
- RenderSceneData (2)
- RenderingDevice
- RenderingServer
- ResourceLoader
- ResourceSaver
- ResourceUID
- ScriptLanguage (1)
- ShaderIncludeDB
- TextServerManager
- ThemeDB
- TileData
- Time
- TranslationServer
- TreeItem
- UndoRedo
- UniformSetCacheRD
- WorkerThreadPool
- XRServer
- XRVRS
- AnimationMixer (2)
- AudioStreamPlayer
- CanvasItem (2)
- CanvasLayer (1)
- EditorFileSystem
- EditorPlugin (1)
- EditorResourcePreview
- HTTPRequest
- InstancePlaceholder
- MissingNode
- MultiplayerSpawner
- MultiplayerSynchronizer
- NavigationAgent2D
- NavigationAgent3D
- Node3D (31)
- ResourcePreloader
- ShaderGlobalsOverride
- StatusIndicator
- Timer
- Viewport (2)
- WorldEnvironment
- BaseButton (3)
- ColorRect
- Container (13)
- GraphEdit
- ItemList
- Label
- LineEdit
- MenuBar
- NinePatchRect
- Panel
- Range (6)
- ReferenceRect
- RichTextLabel
- Separator (2)
- TabBar
- TextEdit (1)
- TextureRect
- Tree
- VideoStreamPlayer
- AspectRatioContainer
- BoxContainer (2)
- CenterContainer
- EditorProperty
- FlowContainer (2)
- GraphElement (2)
- GridContainer
- MarginContainer
- PanelContainer (2)
- ScrollContainer (1)
- SplitContainer (2)
- SubViewportContainer
- TabContainer
Table of contents
-
var base_type: String = "" -
var editable: bool = true -
var edited_resource: Resource -
var toggle_mode: bool = false -
virtual func _handle_menu_selected(id: int) -> bool -
virtual func _set_create_options(menu_node: Object) -> void -
const func get_allowed_types() -> PackedStringArray -
func set_toggle_pressed(pressed: bool) -> void -
signal resource_changed(resource: Resource) -
signal resource_selected(inspect: bool)
EditorResourcePicker #
is_instantiable, resource, Node, editor, not_builtin_classes
Godot editor's control for selecting Resource type properties.
This Control node is used in the editor's Inspector dock to allow editing of Resource type properties. It provides options for creating, loading, saving and converting resources. Can be used with EditorInspectorPlugin to recreate the same behavior.
Note: This Control does not include any editor for the resource, as editing is controlled by the Inspector dock itself or sub-Inspectors.
Members #
var base_type: String = ""#
The base type of allowed resource types. Can be a comma-separated list of several options.
var editable: bool = true#
If true, the value can be selected and edited.
var edited_resource: Resource#
The edited resource value.
var toggle_mode: bool = false#
If true, the main button with the resource preview works in the toggle mode. Use set_toggle_pressed to manually set the state.
Methods #
virtual func _handle_menu_selected(id: int) -> bool#
This virtual method can be implemented to handle context menu items not handled by default. See _set_create_options.
virtual func _set_create_options(menu_node: Object) -> void#
This virtual method is called when updating the context menu of EditorResourcePicker. Implement this method to override the "New ..." items with your own options. menu_node is a reference to the PopupMenu node.
Note: Implement _handle_menu_selected to handle these custom items.
const func get_allowed_types() -> PackedStringArray#
Returns a list of all allowed types and subtypes corresponding to the base_type. If the base_type is empty, an empty list is returned.
func set_toggle_pressed(pressed: bool) -> void#
Sets the toggle mode state for the main button. Works only if toggle_mode is set to true.
Annotations #
Constants #
Constructors #
Enums #
Operators #
Signals #
signal resource_changed(resource: Resource)#
Emitted when the value of the edited resource was changed.
signal resource_selected(inspect: bool)#
Emitted when the resource value was set and user clicked to edit it. When inspect is true, the signal was caused by the context menu "Edit" or "Inspect" option.