Beispiel #1
0
        public static CCNodeLoaderLibrary NewDefaultCCNodeLoaderLibrary()
        {
            var ccNodeLoaderLibrary = new CCNodeLoaderLibrary();

            ccNodeLoaderLibrary.RegisterDefaultCCNodeLoaders();
            return(ccNodeLoaderLibrary);
        }
        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.AddChild(node);

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

            CCDirector.SharedDirector.PushScene(new CCTransitionFade(0.5f, scene, transitionColor));
        }
Beispiel #3
0
        public CCBReader(CCBReader reader)
        {
            mCurrentByte = -1;
            mCurrentBit  = -1;

            mLoadedSpriteSheets  = reader.mLoadedSpriteSheets;
            mCCNodeLoaderLibrary = reader.mCCNodeLoaderLibrary;

            mCCBMemberVariableAssigner = reader.mCCBMemberVariableAssigner;
            mCCBSelectorResolver       = reader.mCCBSelectorResolver;
            mCCNodeLoaderListener      = reader.mCCNodeLoaderListener;
        }
Beispiel #4
0
        public CCBReader(CCNodeLoaderLibrary nodeLoaderLibrary, ICCBMemberVariableAssigner memberVariableAssigner,
                         ICCBSelectorResolver selectorResolver, ICCNodeLoaderListener nodeLoaderListener)
        {
            mCurrentByte = -1;
            mCurrentBit  = -1;

            mLoadedSpriteSheets = new List <string>();

            mCCNodeLoaderLibrary       = nodeLoaderLibrary;
            mCCBMemberVariableAssigner = memberVariableAssigner;
            mCCBSelectorResolver       = selectorResolver;
            mCCNodeLoaderListener      = nodeLoaderListener;
        }
        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);
            }

            CCDirector.SharedDirector.ReplaceScene(this);
        }
Beispiel #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();
        }
        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.AddChild(animationsTest);

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

            CCDirector.SharedDirector.PushScene(new CCTransitionFade(0.5f, scene, transitionColor));
        }
Beispiel #8
0
 public CCBReader(CCNodeLoaderLibrary nodeLoaderLibrary, ICCBMemberVariableAssigner memberVariableAssigner,
                  ICCBSelectorResolver selectorResolver)
     : this(nodeLoaderLibrary, memberVariableAssigner, selectorResolver, null)
 {
 }
Beispiel #9
0
 public CCBReader(CCNodeLoaderLibrary nodeLoaderLibrary, ICCBMemberVariableAssigner memberVariableAssigner)
     : this(nodeLoaderLibrary, memberVariableAssigner, null, null)
 {
 }
Beispiel #10
0
 public CCBReader(CCNodeLoaderLibrary nodeLoaderLibrary)
     : this(nodeLoaderLibrary, null, null, null)
 {
 }
 public static void PurgeSharedCCNodeLoaderLibrary()
 {
     sSharedCCNodeLoaderLibrary = null;
 }
Beispiel #12
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();
        }
Beispiel #13
0
 public CCBReader(CCNodeLoaderLibrary nodeLoaderLibrary, ICCBMemberVariableAssigner memberVariableAssigner)
     : this(nodeLoaderLibrary, memberVariableAssigner, null, null)
 {
 }
 public static void PurgeSharedCCNodeLoaderLibrary()
 {
     _instance = null;
 }
Beispiel #15
0
 public static void PurgeSharedCCNodeLoaderLibrary()
 {
     sSharedCCNodeLoaderLibrary = null;
 }
 public static CCNodeLoaderLibrary NewDefaultCCNodeLoaderLibrary()
 {
     var ccNodeLoaderLibrary = new CCNodeLoaderLibrary();
     ccNodeLoaderLibrary.RegisterDefaultCCNodeLoaders();
     return ccNodeLoaderLibrary;
 }
Beispiel #17
0
 public CCBReader(CCNodeLoaderLibrary nodeLoaderLibrary)
     : this(nodeLoaderLibrary, null, null, null)
 {
 }
Beispiel #18
0
        public CCBReader(CCNodeLoaderLibrary nodeLoaderLibrary, CCBMemberVariableAssigner memberVariableAssigner,
                         CCBSelectorResolver selectorResolver, CCNodeLoaderListener nodeLoaderListener)
        {
            mCurrentByte = -1;
            mCurrentBit = -1;

            mLoadedSpriteSheets = new List<string>();

            mCCNodeLoaderLibrary = nodeLoaderLibrary;
            mCCBMemberVariableAssigner = memberVariableAssigner;
            mCCBSelectorResolver = selectorResolver;
            mCCNodeLoaderListener = nodeLoaderListener;
        }
Beispiel #19
0
 public CCBReader(CCNodeLoaderLibrary nodeLoaderLibrary, ICCBMemberVariableAssigner memberVariableAssigner,
                  ICCBSelectorResolver selectorResolver)
     : this(nodeLoaderLibrary, memberVariableAssigner, selectorResolver, null)
 {
 }
Beispiel #20
0
        public CCBReader(CCBReader reader)
        {
            mCurrentByte = -1;
            mCurrentBit = -1;

            mLoadedSpriteSheets = reader.mLoadedSpriteSheets;
            mCCNodeLoaderLibrary = reader.mCCNodeLoaderLibrary;

            mCCBMemberVariableAssigner = reader.mCCBMemberVariableAssigner;
            mCCBSelectorResolver = reader.mCCBSelectorResolver;
            mCCNodeLoaderListener = reader.mCCNodeLoaderListener;
        }
Beispiel #21
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();
        }
Beispiel #22
0
 public static void PurgeSharedCCNodeLoaderLibrary()
 {
     _instance = null;
 }