HammeriteEditor
Autoloads. Inherits Node
Hammerite editor integration facade (autoload: HammeriteEditor).
Embeds the Hammerite HammeriteMapEditor into a running game scene. This is the editor-dependent counterpart to hammerite-core's Hammerite autoload -- only use this if hammerite-editor is installed and enabled.
Properties
| Type | Name | Default |
|---|---|---|
Control | editor | null |
Control | workspaces | null |
Methods
| Returns | Method |
|---|---|
Control | integrate(into: Node) |
int | register_workspace(title: String, panel: Control) |
void | unregister_workspace(id: int) |
void | show_workspace(id: int) |
bool | is_active() |
Property descriptions
editor
var editor: Control = null
The level editor, a HammeriteMapEditor, or null until integrate() has built it. A Control here, and the editor's classes made by name as it is built, so this autoload compiles in a game that installed Hammerite without its editor. Assign it to a HammeriteMapEditor to have it typed.
workspaces
var workspaces: Control = null
The tab strip the editor lives in, and the seam a game hangs its own authoring on, a HammeriteEditorWorkspaces. Built by integrate(); the level editor is workspace zero.
Method descriptions
integrate()
func integrate(into: Node) -> Control
Creates a Hammerite editor as a child of the given node into. On a layer of its own (HammeriteEditorCanvas) rather than straight into the tree, because the editor is drawn at ITS scale rather than at the host game's - see that class for why a tool should not grow because a game's menus did. Returns the HammeriteMapEditor, as a Control - see editor.
register_workspace()
func register_workspace(title: String, panel: Control) -> int
Offer panel alongside the level editor, on a tab titled title, returning the id to show or unregister it by - see HammeriteEditorWorkspaces.register_workspace(). For authoring that is not about the map in front of you - a game's dialogue, its quests, its loot tables - which wants the whole window rather than a panel, and wants to be in this shell because it keeps asking the open map who is in it.
unregister_workspace()
func unregister_workspace(id: int) -> void
Take a workspace out of the tab strip. The others keep their ids.
show_workspace()
func show_workspace(id: int) -> void
Bring the workspace id to the front, as clicking its tab does. An unknown id is an error.
is_active()
func is_active() -> bool
Returns true if the editor has been integrated and is currently active and visible.