|
world (optional) - a ready world handle; zero or an omitted handle selects the current world (default) pause (optional) - True stops the debug program at the current statement (default); False opens or retargets the editor without stopping the program or taking keyboard focus from the game window |
|
Opens the Blitz3D+ Debug World Editor for the selected world. By default the debug program stops at the current statement. Pass False for pause to open the editor in passive observation mode and let the program continue immediately. Click the editor when you want to interact with it. A debug executable and Graphics3D are required, and it cannot be called by a Worker Function. On Windows, the World Editor button, the globe on the debugger toolbar, does the same for the current world, pausing the program, without a DebugWorld call in your code. The editor renders through its own camera and presentation target, so free-roam navigation does not move a game camera or draw editor helpers into the game window. While stopped, you can inspect the hierarchy, edit supported world and entity properties, create markers/cameras/lights, and use the Assets workspace. Supported source-backed live assets appear there as protected declarations: they can be inspected and placed but not edited or deleted. New assets may be added, previewed, placed and saved. Procedural geometry without a source file remains an entity rather than becoming a reusable asset. Continue and Pause use the same execution state as the normal debugger. Live edits are changes to the current runtime objects. Program code can replace them normally after Continue. Whole-model appearance edits are runtime-only. Save As writes state representable by .world version 1 and reports omitted runtime-only state. Choose All objects to replace programmatic construction with a complete representable world, or New objects only to write an additions layer. The latter excludes existing renderable objects, retains only the parent pivots needed to preserve new-object transforms/hierarchy, and prunes unreferenced original assets. Program-owned entities cannot be deleted or reparented in V1. Entities created by the editor can be deleted, reparented, and undone safely. Custom editors launched with --session connect back through OpenWorldEditorSession. See the Debug World Editor guide for controls, standalone authoring, snapshot limits, and the World Asset Collection workflow. See also: GetWorld, SetWorld, LoadWorldAsync, OpenWorldEditorSession, DebugEntityBounds. |
; DebugWorld Example
; ------------------
Graphics3D 640,480,0,2
SetBuffer BackBuffer()
camera=CreateCamera()
PositionEntity camera,0,1,-5
light=CreateLight()
RotateEntity light,45,45,0
; A named cube so it is easy to find in the editor's hierarchy panel
cube=CreateCube()
NameEntity cube,"Inspectable cube"
EntityColor cube,80,170,255
PositionEntity cube,0,1,0
; False opens the Debug World Editor in passive observation mode: this
; program keeps running while the editor shows the live world. It needs a
; debug executable - run it from the IDE with debugging enabled.
DebugWorld GetWorld(),False
While Not KeyDown(1)
TurnEntity cube,0,1,0
; Arrow keys move the camera
If KeyDown(200) Then MoveEntity camera,0,0,0.1
If KeyDown(208) Then MoveEntity camera,0,0,-0.1
If KeyDown(203) Then TurnEntity camera,0,1,0
If KeyDown(205) Then TurnEntity camera,0,-1,0
RenderWorld
Text 0,0,"Arrow keys: move camera Esc: exit"
Text 0,20,"DebugWorld GetWorld(),False - inspect this scene in the editor window"
Flip
Wend
End