本文整理汇总了C#中Cocos2D.CCBReader.ReadNodeGraphFromFile方法的典型用法代码示例。如果您正苦于以下问题:C# CCBReader.ReadNodeGraphFromFile方法的具体用法?C# CCBReader.ReadNodeGraphFromFile怎么用?C# CCBReader.ReadNodeGraphFromFile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cocos2D.CCBReader
的用法示例。
在下文中一共展示了CCBReader.ReadNodeGraphFromFile方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: openTest
public void openTest(string pCCBFileName, string pCCNodeName, CCNodeLoader pCCNodeLoader)
{
/* Create an autorelease CCNodeLoaderLibrary. */
CCNodeLoaderLibrary ccNodeLoaderLibrary = CCNodeLoaderLibrary.NewDefaultCCNodeLoaderLibrary();
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.Label = (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));
}
示例2: runThisTest
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);
}
示例3: onAnimationsTestClicked
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 = CCNodeLoaderLibrary.NewDefaultCCNodeLoaderLibrary();
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, ref actionManager);
((AnimationsTestLayer) animationsTest).setAnimationManager(actionManager);
mTestTitleLabelTTF.Label = ("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));
}