CocosSharp.CCScene Class
Toplevel node that is used to host CCNodes that share a common CocosSharp.CCWindow and a common CocosSharp.CCViewport.

See Also: CCScene Members


public class CCScene : CCNode


A subclass of CocosSharp.CCNode that renders all children in a common window and viewport. In particular, any node object that wishes to be rendered needs be associated with a parent CCScene (as well as a CocosSharp.CCLayer).

A CCScene object has links to the CocosSharp.CCWindow and CocosSharp.CCViewport. During a draw call to a scene, the viewport is given to the underlying render target.

c# Example

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

        var topLeftViewport = new CCViewport(new CCRect(0.0f, 0.0f, 0.5f, 0.5f));
        var topRightViewport = new CCViewport(new CCRect(0.5f, 0.0f, 0.5f, 0.5f));

        var sceneDirector1 = new CCDirector();
        var sceneDirector2 = new CCDirector();

        var scene1 = new CCScene(mainWindow, topLeftViewport, sceneDirector1) {
            SceneResolutionPolicy = CCSceneResolutionPolicy.Custom

        CCScene scene2 = new CCScene(mainWindow, topRightViewport, sceneDirector2) {
            SceneResolutionPolicy = CCSceneResolutionPolicy.Custom 

        var layer1 = new MyLayer();
        var layer2 = new MyLayer2();




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