CameraKeyBehavior

Package: Libraries.Interface.Behaviors.Scenes.Camera · Inherits from: Libraries.Language.Object, Libraries.Interface.Behaviors.Behavior

The CameraKeyBehavior moves the scene editor's 3D camera while a key is held: one behavior starts a move when the key goes down, and another stops it when the key comes up. The move is one of SceneEditor's camera moves (SceneConstants' CAMERA_LOOK, CAMERA_SLIDE, CAMERA_ORBIT or CAMERA_ZOOM) in a direction: x is -1 for left and 1 for right, y is -1 for down and 1 for up, and for zooming y is 1 for in and -1 for out.

Example Code

use Libraries.Interface.Behaviors.Scenes.Camera.CameraKeyBehavior
use Libraries.Interface.Controls.Scenes.SceneConstants

SceneConstants constants
CameraKeyBehavior lookLeft
lookLeft:Setup(constants:CAMERA_LOOK, -1, 0, true)

Actions

Run(Libraries.Interface.Events.BehaviorEvent event)

Sets the key that holds the move, so the move stops once the key is up however it is let go.

Parameters

SetKey(integer key)

Sets the key that holds the move, so the move stops once the key is up however it is let go.

Parameters

  • key integer: The key's code, such as KeyboardEvent's LEFT

Setup(integer cameraMove, integer x, integer y, boolean starting)

Sets which move, which way, and whether this behavior starts the move (on the key going down) or stops it (on the key coming up).

Parameters

  • cameraMove integer: One of SceneConstants' CAMERA_ moves
  • x integer: -1 left, 1 right, or 0
  • y integer: -1 down or out, 1 up or in, or 0
  • starting boolean: True to start the move, false to stop it

Inherited Actions

7 actions from Libraries.Interface.Behaviors.Behavior
3 actions from Libraries.Language.Object