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)); }
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(); }
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); }
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); 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)); }
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(); }
public CCBReader(CCNodeLoaderLibrary nodeLoaderLibrary, ICCBMemberVariableAssigner memberVariableAssigner, ICCBSelectorResolver selectorResolver) : this(nodeLoaderLibrary, memberVariableAssigner, selectorResolver, null) { }
public CCBReader(CCNodeLoaderLibrary nodeLoaderLibrary, ICCBMemberVariableAssigner memberVariableAssigner) : this(nodeLoaderLibrary, memberVariableAssigner, null, null) { }
public CCBReader(CCNodeLoaderLibrary nodeLoaderLibrary) : this(nodeLoaderLibrary, null, null, null) { }
public static void PurgeSharedCCNodeLoaderLibrary() { _instance = null; }