コード例 #1
0
        /*
         * public CCScene createSceneWithNodeGraphFromFile(string pCCBFileName, object owner, ref CCBAnimationManager animationManager)
         * {
         *
         * }
         */

        public CCScene CreateSceneWithNodeGraphFromFile(string fileName, object owner, CCSize parentSize,
                                                        ref CCBAnimationManager animationManager)
        {
            CCNode  node   = ReadNodeGraphFromFile(fileName, owner, parentSize, ref animationManager);
            CCScene pScene = new CCScene();

            pScene.AddChild(node);

            return(pScene);
        }
コード例 #2
0
ファイル: CCBReader.cs プロジェクト: womandroid/cocos2d-xna
        private bool Init()
        {
            // Setup action manager
            CCBAnimationManager pActionManager = new CCBAnimationManager();

            AnimationManager = pActionManager;

            // Setup resolution scale and container size
            _actionManager.RootContainerSize = CCDirector.SharedDirector.WinSize;

            return(true);
        }
コード例 #3
0
        public bool InitWithData(byte[] bytes, object owner)
        {
            // Setup action manager
            var pActionManager = new CCBAnimationManager();

            AnimationManager = pActionManager;

            // Setup byte array
            mBytes       = bytes;
            mCurrentByte = 0;
            mCurrentBit  = 0;

            mOwner = owner;

            // Setup resolution scale and container size
            mActionManager.RootContainerSize = CCDirector.SharedDirector.WinSize;

            return(true);
        }
コード例 #4
0
ファイル: CCBReader.cs プロジェクト: womandroid/cocos2d-xna
        public CCNode ReadNodeGraphFromData(byte[] bytes, object owner, CCSize parentSize)
        {
            _bytes       = bytes;
            _currentByte = 0;
            _currentBit  = 0;
            _owner       = owner;

            _actionManager.RootContainerSize = parentSize;
            _actionManager._owner            = _owner;
            _ownerOutletNodes   = new List <CCNode>();
            _ownerCallbackNodes = new List <CCNode>();

            Dictionary <CCNode, CCBAnimationManager> animationManagers = new Dictionary <CCNode, CCBAnimationManager>();
            CCNode pNodeGraph = ReadFileWithCleanUp(true, animationManagers);

            if (pNodeGraph != null && _actionManager.AutoPlaySequenceId != -1 && !_jsControlled)
            {
                // Auto play animations
                _actionManager.RunAnimationsForSequenceIdTweenDuration(_actionManager.AutoPlaySequenceId, 0);
            }
            // Assign actionManagers to userObject
            if (_jsControlled)
            {
                _nodesWithAnimationManagers = new List <CCNode>();
                _animationManagersForNodes  = new List <CCBAnimationManager>();
            }

            foreach (var pElement in animationManagers)
            {
                CCNode pNode = pElement.Key;
                CCBAnimationManager manager = animationManagers[pNode];
                pNode.UserObject = manager;

                if (_jsControlled)
                {
                    _nodesWithAnimationManagers.Add(pNode);
                    _animationManagersForNodes.Add(manager);
                }
            }

            return(pNodeGraph);
        }
コード例 #5
0
        public CCScene CreateSceneWithNodeGraphFromFile(string fileName, object owner, CCSize parentSize)
        {
            CCBAnimationManager dummy = null;

            return(CreateSceneWithNodeGraphFromFile(fileName, owner, parentSize, ref dummy));
        }
コード例 #6
0
        public CCNode ReadNodeGraphFromData(byte[] bytes, object owner, CCSize parentSize)
        {
            CCBAnimationManager dummy = null;

            return(ReadNodeGraphFromData(bytes, owner, parentSize, ref dummy));
        }
コード例 #7
0
        public CCNode ReadNodeGraphFromData(byte[] bytes, object owner, CCSize parentSize, ref CCBAnimationManager animationManager)
        {
            InitWithData(bytes, owner);
            mActionManager.RootContainerSize = parentSize;

            CCNode pNodeGraph = ReadFileWithCleanUp(true);

            if (pNodeGraph != null && mActionManager.AutoPlaySequenceId != -1)
            {
                // Auto play animations
                mActionManager.RunAnimations(mActionManager.AutoPlaySequenceId, 0);
            }

            // Return action manager by reference
            animationManager = mActionManager;

            return(pNodeGraph);
        }
コード例 #8
0
        public CCNode ReadNodeGraphFromFile(string fileName, object owner, CCSize parentSize, ref CCBAnimationManager animationManager)
        {
            string pPath = CCFileUtils.FullPathFromRelativePath(fileName);

            byte[] pBytes = CCFileUtils.GetFileBytes(pPath);
            CCNode ret    = ReadNodeGraphFromData(pBytes, owner, parentSize, ref animationManager);

            return(ret);
        }
コード例 #9
0
 public CCNode ReadNodeGraphFromFile(string fileName, object owner, ref CCBAnimationManager animationManager)
 {
     return(ReadNodeGraphFromFile(fileName, owner, CCDirector.SharedDirector.WinSize, ref animationManager));
 }
コード例 #10
0
        public CCNode ReadNodeGraphFromFile(string fileName, object owner, CCSize parentSize)
        {
            CCBAnimationManager dummy = null;

            return(ReadNodeGraphFromFile(fileName, owner, parentSize, ref dummy));
        }
コード例 #11
0
ファイル: CCBReader.cs プロジェクト: rtabbara/cocos2d-xna
        public bool InitWithData(byte[] bytes, object owner)
        {
            // Setup action manager
            var pActionManager = new CCBAnimationManager();
            AnimationManager = pActionManager;

            // Setup byte array
            mBytes = bytes;
            mCurrentByte = 0;
            mCurrentBit = 0;

            mOwner = owner;

            // Setup resolution scale and container size
            mActionManager.RootContainerSize = CCDirector.SharedDirector.WinSize;

            return true;
        }
コード例 #12
0
ファイル: CCBReader.cs プロジェクト: rtabbara/cocos2d-xna
        /*
        public CCScene createSceneWithNodeGraphFromFile(string pCCBFileName, object owner, ref CCBAnimationManager animationManager)
        {
            
        }
        */

        public CCScene CreateSceneWithNodeGraphFromFile(string fileName, object owner, CCSize parentSize,
                                                        ref CCBAnimationManager animationManager)
        {
            CCNode node = ReadNodeGraphFromFile(fileName, owner, parentSize, ref animationManager);
            CCScene pScene = new CCScene();
            pScene.AddChild(node);

            return pScene;
        }
コード例 #13
0
ファイル: CCBReader.cs プロジェクト: rtabbara/cocos2d-xna
        public CCNode ReadNodeGraphFromData(byte[] bytes, object owner, CCSize parentSize, ref CCBAnimationManager animationManager)
        {
            InitWithData(bytes, owner);
            mActionManager.RootContainerSize = parentSize;

            CCNode pNodeGraph = ReadFileWithCleanUp(true);

            if (pNodeGraph != null && mActionManager.AutoPlaySequenceId != -1)
            {
                // Auto play animations
                mActionManager.RunAnimations(mActionManager.AutoPlaySequenceId, 0);
            }

            // Return action manager by reference
            animationManager = mActionManager;

            return pNodeGraph;
        }
コード例 #14
0
ファイル: CCBReader.cs プロジェクト: rtabbara/cocos2d-xna
 public CCNode ReadNodeGraphFromFile(string fileName, object owner, CCSize parentSize, ref CCBAnimationManager animationManager)
 {
     string pPath = CCFileUtils.FullPathFromRelativePath(fileName);
     byte[] pBytes = CCFileUtils.GetFileBytes(pPath);
     CCNode ret = ReadNodeGraphFromData(pBytes, owner, parentSize, ref animationManager);
     return ret;
 }
コード例 #15
0
ファイル: CCBReader.cs プロジェクト: rtabbara/cocos2d-xna
 public CCNode ReadNodeGraphFromFile(string fileName, object owner, ref CCBAnimationManager animationManager)
 {
     return ReadNodeGraphFromFile(fileName, owner, CCDirector.SharedDirector.WinSize, ref animationManager);
 }
コード例 #16
0
ファイル: CCBReader.cs プロジェクト: womandroid/cocos2d-xna
        private bool Init()
        {
            // Setup action manager
            CCBAnimationManager pActionManager = new CCBAnimationManager();
            AnimationManager = pActionManager;
            
            // Setup resolution scale and container size
            _actionManager.RootContainerSize = CCDirector.SharedDirector.WinSize;

            return true;
        }
コード例 #17
0
ファイル: AnimationTest.cs プロジェクト: Ratel13/cocos2d-xna
 public void setAnimationManager(CCBAnimationManager pAnimationManager)
 {
     mAnimationManager = pAnimationManager;
 }