Skip to content

luxe: editor


import "luxe: editor" for Editor

Access to information about the editor, if the game is currently running in the editor. Please note this API is new and heavily work in progress.

Editor.get : unknown

Returns the editor API for access to the editor

Editor.get(context_id : Any) : unknown

Returns the editor context with the given ID. Examples include luxe.editor.world for the world editor, or luxe.editor.tiles.

//We can check if a world is in edit mode via the `edit` tag.
//For example, a scene being previewed in editor is still running in
//the editor, but we don't want to act as if it's being edited.
var is_world_editable = World.tag_has(world, "edit")
if(!is_world_editable) return
//if we're in the editor, we can access the world editor and do some things
var world_editor = Editor.get("luxe.editor.world-editor")
if(world_editor) {
//simple example, make sure the gizmo matches the transform
//if there's no gizmo, the function returns null
var gizmo = world_editor.gizmo
if(gizmo) gizmo.refresh()
}