public override void runThisTest() { /* Create an autorelease CCNodeLoaderLibrary. */ CCNodeLoaderLibrary ccNodeLoaderLibrary = CCNodeLoaderLibrary.NewDefaultCCNodeLoaderLibrary(); 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); foreach (CCNode c in node.Children) { CCLog.Log("Node is at {0},{1}", c.PositionX, c.PositionY); } if (node != null) { AddChild(node); } CCDirector.SharedDirector.ReplaceScene(this); }
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 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 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); }