Camera API

editor.selectCamera(type)
  • type - the camera type. Allowed values:
    • editor.CameraType_Game - the gameplay camera
    • editor.CameraType_Free - the editor free fly-by camera Sets the current camera in the editor's viewport.
editor.isFreeCamera()

Returns true if the camera is free camera mode.

editor.toggleFreeCamera()

Toggles between current in-game camera and free fly (editor) camera.

editor.getCamera()

Returns the current editor camera

editor.cameraLookAtPoint(pt)
  • pt - the point in world where the camera should look at

Orients the camera to look at a specific world point.

editor.placeCameraAtSelection()

Sets the camera position at the center of the current object selection.

editor.placeCameraAtPlayer()

Sets the camera position at the current player position.

editor.placePlayerAtCamera()

Sets the player position at the current editor camera position.

editor.fitViewToSelection()

Fit/position the camera viewport to the bounding box of the selected objects, so one can view the entire selection.

editor.setCameraSpeed(speed)
  • speed - the speed of the fly camera movement. Allowed values:
    • editor.CameraSpeed_Slowest
    • editor.CameraSpeed_Slow
    • editor.CameraSpeed_Slower
    • editor.CameraSpeed_Normal
    • editor.CameraSpeed_Faster
    • editor.CameraSpeed_Fast
    • editor.CameraSpeed_Fastest Sets the speed of the editor fly camera.
editor.addCameraBookmark(name)
  • name - the name of the bookmark Returns the id of the bookmark object

Adds a new named camera bookmark at the current world position.

editor.deleteCameraBookmark(objectId)
  • objectId - the object id of the bookmark

Deletes a camera bookmark by its name.

editor.getCameraBookmarks()

Returns the bookmarks SimGroup object, where the bookmarks are kept.

editor.copyCameraBookmarkToClipboard(obj)
  • obj - the camera bookmark object to copy

Copies the camera bookmark to clipboard as text.

editor.pasteCameraBookmarkFromClipboard()

Paste the camera bookmark from clipboard.

editor.clearCameraBookmarks()

Delete all the camera bookmarks.

editor.jumpToCameraBookmark(objectId)
  • objectId - the object id of the bookmark to jump to

Jump to the camera bookmark.

editor.getObjectLocationText(obj)
  • obj - the object to get position text for.

Return the object location as text. Used internally by the editor.

Last modified: 7 December 2021, at 14:30

Any further questions?

Join our discord