Instance Methodmigueldeicaza.swiftgodot 0.45.0SwiftGodot
getEditorTheme
Returns the editor’s Theme
.
final func getEditorTheme() -> Theme?
Other members in extension
Type members
Instance members
var distractionFreeMode: Bool
If
true
, enables distraction-free mode which hides side docks to increase the space available for the main view.var movieMakerEnabled: Bool
If
true
, the Movie Maker mode is enabled in the editor. SeeMovieWriter
for more information.func editNode(Node?
) Edits the given
Node
. The node will be also selected if it’s inside the scene tree.func editResource(Resource?
) Edits the given
Resource
. If the resource is aScript
you can also edit it witheditScript(_:line:column:grabFocus:)
to specify the line and column position.func editScript(Script?, line: Int32, column: Int32, grabFocus: Bool
) Edits the given
Script
. The line and column on which to open the script can also be specified. The script will be open with the user-configured editor for the script’s language which may be an external editor.func getBaseControl(
) -> Control? Returns the main container of Godot editor’s window. For example, you can use it to retrieve the size of the container and place your controls accordingly.
func getCommandPalette(
) -> EditorCommandPalette? Returns the editor’s
EditorCommandPalette
instance.func getCurrentDirectory(
) -> String Returns the current directory being viewed in the
FileSystemDock
. If a file is selected, its base directory will be returned usingString/getBaseDir()
instead.func getCurrentFeatureProfile(
) -> String Returns the name of the currently activated feature profile. If the default profile is currently active, an empty string is returned instead.
func getCurrentPath(
) -> String Returns the current path being viewed in the
FileSystemDock
.func getEditedSceneRoot(
) -> Node? Returns the edited (current) scene’s root
Node
.func getEditorMainScreen(
) -> VBoxContainer? Returns the editor control responsible for main screen plugins and tools. Use it with plugins that implement
_hasMainScreen
.func getEditorPaths(
) -> EditorPaths? Returns the
EditorPaths
singleton.func getEditorScale(
) -> Double Returns the actual scale of the editor UI (
1.0
being 100% scale). This can be used to adjust position and dimensions of the UI added by plugins.func getEditorSettings(
) -> EditorSettings? Returns the editor’s
EditorSettings
instance.func getEditorViewport2d(
) -> SubViewport? Returns the 2D editor
SubViewport
. It does not have a camera. Instead, the view transforms are done directly and can be accessed withglobalCanvasTransform
.func getEditorViewport3d(idx: Int32
) -> SubViewport? Returns the specified 3D editor
SubViewport
, from0
to3
. The viewport can be used to access the active editor cameras withgetCamera3d
.func getFileSystemDock(
) -> FileSystemDock? Returns the editor’s
FileSystemDock
instance.func getInspector(
) -> EditorInspector? Returns the editor’s
EditorInspector
instance.func getOpenScenes(
) -> PackedStringArray Returns an
GArray
with the file paths of the currently opened scenes.func getPlayingScene(
) -> String Returns the name of the scene that is being played. If no scene is currently being played, returns an empty string.
func getResourceFilesystem(
) -> EditorFileSystem? Returns the editor’s
EditorFileSystem
instance.func getResourcePreviewer(
) -> EditorResourcePreview? Returns the editor’s
EditorResourcePreview
instance.func getScriptEditor(
) -> ScriptEditor? Returns the editor’s
ScriptEditor
instance.func getSelectedPaths(
) -> PackedStringArray Returns an array containing the paths of the currently selected files (and directories) in the
FileSystemDock
.func getSelection(
) -> EditorSelection? Returns the editor’s
EditorSelection
instance.func inspectObject(Object?, forProperty: String, inspectorOnly: Bool
) Shows the given property on the given
object
in the editor’s Inspector dock. IfinspectorOnly
istrue
, plugins will not attempt to editobject
.func isPlayingScene(
) -> Bool Returns
true
if a scene is currently being played,false
otherwise. Paused scenes are considered as being played.func isPluginEnabled(plugin: String
) -> Bool Returns
true
if the specifiedplugin
is enabled. The plugin name is the same as its directory name.func makeMeshPreviews(meshes: ObjectCollection<Mesh>, previewSize: Int32
) -> ObjectCollection<Texture2D> Returns mesh previews rendered at the given size as an
GArray
ofTexture2D
s.func markSceneAsUnsaved(
) Marks the current scene tab as unsaved.
func openSceneFromPath(sceneFilepath: String
) Opens the scene at the given path.
func playCurrentScene(
) Plays the currently active scene.
func playCustomScene(sceneFilepath: String
) Plays the scene specified by its filepath.
func playMainScene(
) Plays the main scene.
func popupDialog(Window?, rect: Rect2i
) Pops up the
dialog
in the editor UI withpopupExclusive(fromNode:rect:)
. The dialog must have no current parent, otherwise the method fails.func popupDialogCentered(dialog: Window?, minsize: Vector2i
) Pops up the
dialog
in the editor UI withpopupExclusiveCentered(fromNode:minsize:)
. The dialog must have no current parent, otherwise the method fails.func popupDialogCenteredClamped(dialog: Window?, minsize: Vector2i, fallbackRatio: Double
) Pops up the
dialog
in the editor UI withpopupExclusiveCenteredClamped(fromNode:minsize:fallbackRatio:)
. The dialog must have no current parent, otherwise the method fails.func popupDialogCenteredRatio(dialog: Window?, ratio: Double
) Pops up the
dialog
in the editor UI withpopupExclusiveCenteredRatio(fromNode:ratio:)
. The dialog must have no current parent, otherwise the method fails.func reloadSceneFromPath(sceneFilepath: String
) Reloads the scene at the given path.
func restartEditor(save: Bool
) Restarts the editor. This closes the editor and then opens the same project. If
save
istrue
, the project will be saved before restarting.func saveAllScenes(
) Saves all opened scenes in the editor.
func saveScene(
) -> GodotError Saves the currently active scene. Returns either
ok
orerrCantCreate
.func saveSceneAs(path: String, withPreview: Bool
) Saves the currently active scene as a file at
path
.func selectFile(String
) Selects the file, with the path provided by
file
, in the FileSystem dock.func setCurrentFeatureProfile(profileName: String
) Selects and activates the specified feature profile with the given
profileName
. SetprofileName
to an empty string to reset to the default feature profile.func setMainScreenEditor(name: String
) Sets the editor’s current main screen to the one specified in
name
.name
must match the title of the tab in question exactly (e.g.2D
,3D
, [code skip-lint]Script, or
AssetLib` for default tabs).func setPluginEnabled(plugin: String, enabled: Bool
) Sets the enabled status of a plugin. The plugin name is the same as its directory name.
func stopPlayingScene(
) Stops the scene that is currently playing.