-
Notifications
You must be signed in to change notification settings - Fork 0
Camera2D
Namespace: Electron2D
Provides the Electron2D 2D camera node for selecting the visible canvas region.
public class Electron2D.Camera2D : Electron2D.Node2DCamera2D can become current on the nearest ancestor Electron2D.Viewport.
Electron2D 0.1.0 Preview implements target position, offset, zoom and
rotation behavior; camera limits, drag margins and smoothing are intentionally
not implemented yet.
This type is not synchronized. Create and mutate cameras on the main scene thread.
This type is available since Electron2D 0.1.0 Preview.
Electron2D.Viewport
| Member | Kind | Summary |
|---|---|---|
Enabled |
Property | Gets or sets whether this camera can become current. |
IgnoreRotation |
Property | Gets or sets whether the camera ignores its node rotation. |
Offset |
Property | Gets or sets the camera target offset. |
Zoom |
Property | Gets or sets the camera zoom. |
Electron2D.Camera2D() |
Constructor | Initializes a new instance of the Camera2D type. |
Align() |
Method | Aligns the camera to the tracked position. |
ClearCurrent(System.Boolean) |
Method | Clears this camera as the current camera on its viewport. |
ForceUpdateScroll() |
Method | Forces the camera scroll state to update immediately. |
GetScreenCenterPosition() |
Method | Gets the screen center position in global coordinates. |
GetScreenRotation() |
Method | Gets the camera screen rotation in radians. |
GetTargetPosition() |
Method | Gets the camera target position in global coordinates. |
IsCurrent() |
Method | Checks whether this camera is current on its viewport. |
MakeCurrent() |
Method | Makes this camera current on the nearest ancestor viewport. |
ResetSmoothing() |
Method | Resets camera smoothing state. |
_EnterTree() |
Method | Called when this node enters a scene tree. |
_ExitTree() |
Method | Called when this node exits a scene tree. |
Kind: Property
public System.Boolean Enabled { get; set; }Gets or sets whether this camera can become current.
When the current camera is disabled, its viewport clears the current
camera and may select another enabled camera when requested by
Electron2D.Camera2D.ClearCurrent(System.Boolean).
The current enabled value.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.Camera2D
Kind: Property
public System.Boolean IgnoreRotation { get; set; }Gets or sets whether the camera ignores its node rotation.
This property follows the validation and lifetime rules of its declaring type.
The current ignore rotation value.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.Camera2D
Kind: Property
public Electron2D.Vector2 Offset { get; set; }Gets or sets the camera target offset.
This property follows the validation and lifetime rules of its declaring type.
The current offset value.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.Camera2D
Kind: Property
public Electron2D.Vector2 Zoom { get; set; }Gets or sets the camera zoom.
Higher values zoom in. Each component must be finite and non-zero.
The current zoom value.
This property is not synchronized. Mutate it on the main scene thread.
This property is available since Electron2D 0.1.0 Preview.
Electron2D.Camera2D
Kind: Constructor
public Electron2D.Camera2D()Initializes a new instance of the Camera2D type.
The new instance follows the lifetime and validation rules of its declaring type.
This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.
This API is available since Electron2D 0.1.0 Preview.
Electron2D.Camera2D
Kind: Method
public System.Void Align()()Aligns the camera to the tracked position.
This is a no-op in Electron2D 0.1.0 Preview because camera smoothing and drag margins are not implemented yet.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Camera2D
Kind: Method
public System.Void ClearCurrent(System.Boolean)(System.Boolean enableNext)Clears this camera as the current camera on its viewport.
This method follows the validation and lifetime rules of its declaring type.
-
enableNext: Iftrue, the viewport selects the first enabled camera in tree order after this camera is cleared.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Camera2D
Kind: Method
public System.Void ForceUpdateScroll()()Forces the camera scroll state to update immediately.
This is a no-op in Electron2D 0.1.0 Preview because smoothing state is not implemented yet.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Camera2D
Kind: Method
public Electron2D.Vector2 GetScreenCenterPosition()()Gets the screen center position in global coordinates.
This method follows the validation and lifetime rules of its declaring type.
The camera target position for the 0.1.0 Preview baseline.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Camera2D.GetTargetPosition
Kind: Method
public System.Single GetScreenRotation()()Gets the camera screen rotation in radians.
This method follows the validation and lifetime rules of its declaring type.
0 when Electron2D.Camera2D.IgnoreRotation is true; otherwise, Electron2D.Node2D.GlobalRotation.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Camera2D
Kind: Method
public Electron2D.Vector2 GetTargetPosition()()Gets the camera target position in global coordinates.
This method follows the validation and lifetime rules of its declaring type.
Electron2D.Node2D.GlobalPosition plus Electron2D.Camera2D.Offset.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Camera2D
Kind: Method
public System.Boolean IsCurrent()()Checks whether this camera is current on its viewport.
This method follows the validation and lifetime rules of its declaring type.
true if this camera is the active 2D camera; otherwise, false.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Camera2D
Kind: Method
public System.Void MakeCurrent()()Makes this camera current on the nearest ancestor viewport.
This method follows the validation and lifetime rules of its declaring type.
-
System.InvalidOperationException: Thrown when the camera is not a descendant of aElectron2D.Viewport.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Camera2D
Kind: Method
public System.Void ResetSmoothing()()Resets camera smoothing state.
This is a no-op in Electron2D 0.1.0 Preview because smoothing state is not implemented yet.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Camera2D
Kind: Method
public System.Void _EnterTree()()Called when this node enters a scene tree.
This method follows the validation and lifetime rules of its declaring type.
This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.
This API is available since Electron2D 0.1.0 Preview.
Electron2D.Camera2D
Kind: Method
public System.Void _ExitTree()()Called when this node exits a scene tree.
This method follows the validation and lifetime rules of its declaring type.
This member is not synchronized. Call it from the thread that owns the related object unless the declaring type states otherwise.
This API is available since Electron2D 0.1.0 Preview.
Electron2D.Camera2D
Electron2D 0.1.0 Preview API reference. Generated from 175 public runtime types.