Inheritance Hierarchy
DeltaEngine.Entities Entity
CreepyTowers GameCamera
Namespace: CreepyTowers
Assembly: CreepyTowers (in CreepyTowers.exe) Version: 1.1.1.0 (1.1.1)
Syntax
The GameCamera type exposes the following members.
Constructors
Name | Description | |
---|---|---|
GameCamera | Initializes a new instance of the GameCamera class |
Methods
Name | Description | |
---|---|---|
Add T | (Inherited from Entity.) | |
AddTag | (Inherited from Entity.) | |
ClearTags | (Inherited from Entity.) | |
Contains T | (Inherited from Entity.) | |
ContainsBehavior T | (Inherited from Entity.) | |
ContainsTag | (Inherited from Entity.) | |
Deactivate | (Inherited from Entity.) | |
Dispose | (Overrides Entity Dispose .) | |
Get T |
Gets a specific component, derived classes can return faster cached values (e.g. Entity2D)
View code on GitHub (Inherited from Entity.) | |
GetActiveBehaviors | (Inherited from Entity.) | |
GetComponentsForSaving | (Inherited from Entity.) | |
GetOrDefault T | (Inherited from Entity.) | |
GetTags | (Inherited from Entity.) | |
MoveCameraByMouse | ||
Remove T | (Inherited from Entity.) | |
RemoveTag | (Inherited from Entity.) | |
ResetPositionToDefault | ||
ResetToMinZoom | ||
Set | (Inherited from Entity.) | |
SetComponents | (Inherited from Entity.) | |
Start T | (Inherited from Entity.) | |
Stop T | (Inherited from Entity.) | |
ToString | (Inherited from Entity.) |
Fields
Name | Description | |
---|---|---|
components | (Inherited from Entity.) |
Properties
Name | Description | |
---|---|---|
AllowedMovementRect | ||
IsActive | (Inherited from Entity.) | |
IsPauseable | (Inherited from Entity.) | |
MaximumTurnAngle | ||
MaxZoom | ||
MinZoom | ||
NumberOfComponents | (Inherited from Entity.) | |
Position | ||
RotationPerSecond | ||
UpdatePriority | (Inherited from Entity.) | |
ZoomLevel | ||
ZoomSmoothFactor |
Remarks
Examples
[Test] public void RenderCubeUsingGameCamera() { var cubeMesh = new BoxMesh(Vector3D.One, Color.DarkGreen); new Model(new ModelData(cubeMesh), new Vector3D(0.0f, 0.0f, 0.0f)); new Line3D(2 * Vector3D.UnitX, -3 * Vector3D.UnitY, Color.Red); }
[Test, CloseAfterFirstFrame] public void MouseDragWillDragCamera() { if(!IsMockResolver) return; //ncrunch: no coverage MockMouse mouse = (MockMouse)Resolve<Mouse>(); var originalPosition = gameCamera.Position; bool dragInvoked = false; new Command("ViewPanning", () => dragInvoked = true); mouse.SetNativePosition(ScreenSpace.Current.Viewport.TopLeft + new Vector2D(0.1f, 0.1f)); mouse.SetButtonState(MouseButton.Middle, State.Pressing); AdvanceTimeAndUpdateEntities(); mouse.SetNativePosition(ScreenSpace.Current.Viewport.TopRight + new Vector2D(-0.1f, 0.1f)); mouse.SetButtonState(MouseButton.Middle, State.Pressed); AdvanceTimeAndUpdateEntities(); Assert.IsTrue(dragInvoked); Assert.AreNotEqual(originalPosition, gameCamera.Position); Assert.AreEqual(135.0f, (gameCamera.Position - originalPosition).Angle(Vector3D.UnitY)); }
[Test, CloseAfterFirstFrame] public void MouseZoomWillZoomCamera() { if (!IsMockResolver) return; //ncrunch: no coverage MockMouse mouse = (MockMouse)Resolve<Mouse>(); var originalZoom = gameCamera.ZoomLevel; mouse.ScrollUp(); AdvanceTimeAndUpdateEntities(); Assert.AreNotEqual(originalZoom, gameCamera.ZoomLevel); }
See Also