示例#1
0
        public void openTest(string pCCBFileName, string pCCNodeName, CCNodeLoader pCCNodeLoader)
        {
            /* Create an autorelease CCNodeLoaderLibrary. */
            CCNodeLoaderLibrary ccNodeLoaderLibrary = new CCNodeLoaderLibrary();

            ccNodeLoaderLibrary.RegisterCCNodeLoader("TestHeaderLayer", new Loader<TestHeaderLayer>());
            if (pCCNodeName != null && pCCNodeLoader != null)
            {
                ccNodeLoaderLibrary.RegisterCCNodeLoader(pCCNodeName, pCCNodeLoader);
            }

            /* Create an autorelease CCBReader. */
            var ccbReader = new CCBReader(ccNodeLoaderLibrary);

            /* Read a ccbi file. */
            // Load the scene from the ccbi-file, setting this class as
            // the owner will cause lblTestTitle to be set by the CCBReader.
            // lblTestTitle is in the TestHeader.ccbi, which is referenced
            // from each of the test scenes.
            CCNode node = ccbReader.ReadNodeGraphFromFile(pCCBFileName, this);

            mTestTitleLabelTTF.Text = (pCCBFileName);

            CCScene scene = new CCScene(Scene);
            scene.AddChild(node);

            /* Push the new scene with a fancy transition. */
            CCColor3B transitionColor = new CCColor3B();
            transitionColor.R = 0;
            transitionColor.G = 0;
            transitionColor.B = 0;

            Scene.Director.PushScene(new CCTransitionFade(0.5f, scene, transitionColor));
        }
示例#2
0
        public CCBReader(CCNodeLoaderLibrary nodeLoaderLibrary, ICCBMemberVariableAssigner memberVariableAssigner,
                         ICCBSelectorResolver selectorResolver, ICCNodeLoaderListener nodeLoaderListener)
        {
            _currentByte = -1;
            _currentBit  = -1;

            _loadedSpriteSheets = new List <string>();

            _nodeLoaderLibrary         = nodeLoaderLibrary;
            _CCBMemberVariableAssigner = memberVariableAssigner;
            _CCBSelectorResolver       = selectorResolver;
            _nodeLoaderListener        = nodeLoaderListener;
            Init();
        }
示例#3
0
        public override void runThisTest()
        {
            /* Create an autorelease CCNodeLoaderLibrary. */
            CCNodeLoaderLibrary ccNodeLoaderLibrary = new CCNodeLoaderLibrary();

            ccNodeLoaderLibrary.RegisterCCNodeLoader("HelloCocosBuilderLayer", new Loader<HelloCocosBuilderLayer>());

            /* Create an autorelease CCBReader. */
            var ccbReader = new CCBReader(ccNodeLoaderLibrary);

            /* Read a ccbi file. */
            CCNode node = ccbReader.ReadNodeGraphFromFile("ccb/HelloCocosBuilder.ccbi", this);

            if (node != null)
            {
                AddChild(node);
            }

            Scene.Director.ReplaceScene(this);
        }
示例#4
0
        public CCBReader(CCBReader reader)
        {
            _currentByte = -1;
            _currentBit  = -1;

            _loadedSpriteSheets = reader._loadedSpriteSheets;
            _nodeLoaderLibrary  = reader._nodeLoaderLibrary;

            _CCBMemberVariableAssigner = reader._CCBMemberVariableAssigner;
            _CCBSelectorResolver       = reader._CCBSelectorResolver;
            _nodeLoaderListener        = reader._nodeLoaderListener;

            _ownerCallbackNames = reader._ownerCallbackNames;
            _ownerCallbackNodes = reader._ownerCallbackNodes;
            _ownerOutletNames   = reader._ownerOutletNames;
            _ownerOutletNodes   = reader._ownerOutletNodes;

            _CCBRootPath = reader.CCBRootPath;

            Init();
        }
示例#5
0
        public void onAnimationsTestClicked(object pSender, CCControlEvent pCCControlEvent)
        {
            // Load node graph (TestAnimations is a sub class of CCLayer) and retrieve the ccb action manager
            CCBAnimationManager actionManager = null;

            /* Create an autorelease CCNodeLoaderLibrary. */
            CCNodeLoaderLibrary ccNodeLoaderLibrary = new CCNodeLoaderLibrary();

            ccNodeLoaderLibrary.RegisterCCNodeLoader("TestHeaderLayer", new Loader<TestHeaderLayer>());
            ccNodeLoaderLibrary.RegisterCCNodeLoader("TestAnimationsLayer", new Loader<AnimationsTestLayer>());


            /* Create an autorelease CCBReader. */
            var ccbReader = new CCBReader(ccNodeLoaderLibrary);

            /* Read a ccbi file. */
            // Load the scene from the ccbi-file, setting this class as
            // the owner will cause lblTestTitle to be set by the CCBReader.
            // lblTestTitle is in the TestHeader.ccbi, which is referenced
            // from each of the test scenes.
            CCNode animationsTest = ccbReader.ReadNodeGraphFromFile("ccb/ccb/TestAnimations.ccbi", this);
            ((AnimationsTestLayer) animationsTest).setAnimationManager(ccbReader.AnimationManager);

            mTestTitleLabelTTF.Text = ("TestAnimations.ccbi");

            CCScene scene = new CCScene(Scene);
            scene.AddChild(animationsTest);

            /* Push the new scene with a fancy transition. */
            CCColor3B transitionColor = new CCColor3B();
            transitionColor.R = 0;
            transitionColor.G = 0;
            transitionColor.B = 0;

            Scene.Director.PushScene(new CCTransitionFade(0.5f, scene, transitionColor));
        }
示例#6
0
        public CCBReader(CCBReader reader)
        {
            _currentByte = -1;
            _currentBit = -1;

            _loadedSpriteSheets = reader._loadedSpriteSheets;
            _nodeLoaderLibrary = reader._nodeLoaderLibrary;

            _CCBMemberVariableAssigner = reader._CCBMemberVariableAssigner;
            _CCBSelectorResolver = reader._CCBSelectorResolver;
            _nodeLoaderListener = reader._nodeLoaderListener;

            _ownerCallbackNames = reader._ownerCallbackNames;
            _ownerCallbackNodes = reader._ownerCallbackNodes;
            _ownerOutletNames = reader._ownerOutletNames;
            _ownerOutletNodes = reader._ownerOutletNodes;

            _CCBRootPath = reader.CCBRootPath;

            Init();
        }
示例#7
0
        public CCBReader(CCNodeLoaderLibrary nodeLoaderLibrary, ICCBMemberVariableAssigner memberVariableAssigner,
                         ICCBSelectorResolver selectorResolver, ICCNodeLoaderListener nodeLoaderListener)
        {
            _currentByte = -1;
            _currentBit = -1;

            _loadedSpriteSheets = new List<string>();

            _nodeLoaderLibrary = nodeLoaderLibrary;
            _CCBMemberVariableAssigner = memberVariableAssigner;
            _CCBSelectorResolver = selectorResolver;
            _nodeLoaderListener = nodeLoaderListener;
            Init();
        }
示例#8
0
 public CCBReader(CCNodeLoaderLibrary nodeLoaderLibrary, ICCBMemberVariableAssigner memberVariableAssigner,
                  ICCBSelectorResolver selectorResolver)
     : this(nodeLoaderLibrary, memberVariableAssigner, selectorResolver, null)
 {
 }
示例#9
0
 public CCBReader(CCNodeLoaderLibrary nodeLoaderLibrary, ICCBMemberVariableAssigner memberVariableAssigner)
     : this(nodeLoaderLibrary, memberVariableAssigner, null, null)
 {
 }
示例#10
0
 public CCBReader(CCNodeLoaderLibrary nodeLoaderLibrary)
     : this(nodeLoaderLibrary, null, null, null)
 {
 }
示例#11
0
 public CCBReader(CCNodeLoaderLibrary nodeLoaderLibrary, ICCBMemberVariableAssigner memberVariableAssigner,
                  ICCBSelectorResolver selectorResolver)
     : this(nodeLoaderLibrary, memberVariableAssigner, selectorResolver, null)
 {
 }
示例#12
0
 public CCBReader(CCNodeLoaderLibrary nodeLoaderLibrary, ICCBMemberVariableAssigner memberVariableAssigner)
     : this(nodeLoaderLibrary, memberVariableAssigner, null, null)
 {
 }
示例#13
0
 public CCBReader(CCNodeLoaderLibrary nodeLoaderLibrary)
     : this(nodeLoaderLibrary, null, null, null)
 {
 }
示例#14
0
 public static void PurgeSharedCCNodeLoaderLibrary()
 {
     _instance = null;
 }
示例#15
0
 public static void PurgeSharedCCNodeLoaderLibrary()
 {
     _instance = null;
 }