CocosSharp.CCCamera Class
Represents a camera whose properties specify the underlying view and projection matrices.

See Also: CCCamera Members

Syntax

public class CCCamera

Remarks

A user can alter a camera’s position, target, projection etc. and in-turn this will update the camera’s corresponding view and projection matrices.

A camera is associated with a CocosSharp.CCLayer layer when rendering. All children of the layer will then be rendered relative to the parent's camera.

c# Example

// Using a custom camera

public class AppDelegate : CCApplicationDelegate
{
    public override void ApplicationDidFinishLaunching(CCApplication application, CCWindow mainWindow)
    {
        mainWindow.SetDesignResolutionSize(960, 640, CCSceneResolutionPolicy.ShowAll);

        var scene = new CCScene(mainWindow);
        var layer = new MyLayer();

        var cameraVisibleBounds = new CCSize(1000, 500);
        var cameraTarget = new CCPoint3(0, 0, 3);
        var cameraPosition = new CCPoint3(0, 0, 100);
        var camera = new CCCamera(cameraVisibleBounds, cameraPosition, cameraTarget);
        
        layer.Camera = Camera;

        scene.AddChild(layer);
        sharedWindow.RunWithScene(scene);
    }
}
	

Requirements

Namespace: CocosSharp
Assembly: CocosSharp (in CocosSharp.dll)