cocos2dx进阶学习之CCBI文件

在马里奥这个游戏里,我们用到了几个ccbi文件,比如蘑菇怪,马里奥等,下面是加载马里奥代码

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAuYAAAFPCAIAAACOAJy/AAAgAElEQVR4nO3da5KjOrYGUE+i59tzuQPl/jin3BSStjYCY4TXiooKpyz0AGx9KWdlvRYAgNt7fXsAAAB9IgsAMAGRBQCYgMgCAExAZAEAJiCyAAATEFkAgAmILADABO4YWV7/TY2qrNY68F0etLx5Klkz32CyTnxUt838LABgLl9Y0qrraGat7dY5N7Ks/5Ql1T+tTlt1lnQA6tZ8DzI5XwCYy9VLWpxFMkGh1VQ3rwR18q0NNHh8VyafkNbl8goAT3KvyFItrD4ok02rtdZT1dbKxruHl8POt5DJIq25xJ1WzxIAzOvSlWwgryy1yLK048tmhW4lhuADmni7Jflxz66a1fHEs2vloerE5RUAHuCOkWWzcdKNLK02WxswrUPiXZagneoU4mFXBxzYtFYGqfXgq4cAwNSuW8zyeSWzNVIu4a2djNY+RNlpdUhx4Kg2uEkPuzaH4il0008+1QHAXO4VWaq7I5ntlmAtr35W0up0qYWJbmvxLILWWmNel8fbJ0EvwZYSAEznovUsucVSlsePM9sP5SqeGWGwoRJvjWQCVrXrZLYI9k7irgFgarNGluPVqk/FH9Mke9wUxjW77ayf7WaRzUZOsK8DAHO5Yj3blVeW9m5BvMvS/Sin7DT5VLd+N7JkxhY0tanQjXrBFhQATOq+kWXXnko+fLS2TwYiSyuIbCpXxxYnj2DM+UO60wGAiVjJAIAJiCwAwAREFgBgAiILADABkQUAmIDIAgBM4KaR5fXH+vG6MHNgXLhp+cggxw7vtnxua8kGPzQjADjojivTe70sH2wed1sICve2GbT2iQX+rDZ3jbN6wgHgDu64MlW3Qw62sJwdMj69qH83sgDA3Vzy22/3f6yzqdn67j/4xKfaeLfCuqPycWtU3WkOFAYn6lVo1czMujv4+EAAuMZFS9F7yV+GvtePc0x5yFhkCeq0kkFmSAcLD9rVpmgCw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usclsdNYCH6fG6jgPJonLIsvxsxR/Gce1y26G4HCAx7vu7e/1t+HC4MtdDQblS+276lZ36y+rbe7qulUSnM+BE1JtNjgVrTPQmlGrTrKjeEaZLwfaTM69Nc3lklPhKzcAAAH8SURBVJvh3Ut1ptVygMfwNte0XnhuMhIC15ylTaS4oMdW7/mnAJ7B21xH9Tvdi3v/StcTufgsffeWAPhZ3nYBgAmILADABEQWAGACIgsAMAGRhYr4Z0v95CkA1/va2lP9ZRVj7QwPYOzAoMHqb9cYaOf0mpuj4tNe/iKQ/G8HAYAP+ebCs1k7vzKAcw//0C/t+ES6ClpuzeK7v5IEgB/305FlObb0PjKyBLspNloA+KKLfmFo9ROTVmRJ1gw+19iVgVqfgwRDCmbUelwOqWwh6Ld7ioJxLsUZrpZUz8a7pFWeKQSA4y5aYKpr+Xot3BRWH2fWyPLwVyFoJBhn/Hg9yEyOCdpJhoP4wDK1lBXykaUVj6qjAoBPuF1keT8VLPytllsd5ce21NbyVuIZ2HgYDg3JkZePT4+A3VEBwCfcMbJktiJa5XsjS6bZZNetmntTzgWRpfpsvs14VADwCbeLLN2PVIKWk4cEFfZuVHQb3Ntmvtn4wOHIEoxtYAcLAM5yXWTZfLDyfvz+e/PUun55eLXaprw7pMw44zarww6ajTtqzWjTUX7urS/fha1JdefeOr3d0w4AY76wy8L9xdcreNaFBuBDrlhgktseAAAtYgQAMAGRBQCYgMgCAExAZAEAJiCyAAATEFkAgAmILADABEQWAGACIgsAMIH/B3LeMrROKMfTAAAAAElFTkSuQmCC" alt="" />

从这个代码可以看出,马里奥不是个精灵,是一个CCNode对象,是CCBReader对象从一个文件读出来的CCNode,那mario.ccbi究竟是什么文件呢?

ccbi文件是cocosbuilder软件制作的场景资源,现在可以包含动画,像mario.ccbi就包含了一些动画在里面。

资源的加载:

ccbi资源的加载需要用CCBReader对象,创建CCBReader对象又需要CCNodeLoadLibrary对象,所以综合起来代码是:

1)先创建CCNodeLoadLibrary对象

2)通过CCNodeLoadLibrary对象创建CCBReader对象

3)根据CCBReader对象去加载ccbi文件

将来还需要通过CCBReader对象去播放动画,因此在这个设计里,CCBReader对象被定义为成员变量保存,能长期使用。

播放动画:

当马里奥移动时,手臂会摆动,这个时候需要让该CCNode对象去播放动画,播放动画的代码如下:

//根据状态播放动画
switch(m_eCurMarioLevel)
{
case enMarioLevelSmall:
{
m_pCcbReader->getAnimationManager()->runAnimationsForSequenceNamed(_CCB_MARIO_SMALL_HOLD_);
}break;
case enMarioLevelBig:
{
m_pCcbReader->getAnimationManager()->runAnimationsForSequenceNamed(_CCB_MARIO_BIG_HOLD_);
}break;
case enMarioLevelMax:
{
m_pCcbReader->getAnimationManager()->runAnimationsForSequenceNamed(_CCB_MARIO_MAX_HOLD_);
}break;
}

根据马里奥的状态来播放不同的动画。

上一篇:JavaScript 概览 更新时间2014-0414-0837


下一篇:Dynamics CRM 插件Plugin中获取和更新时间字段值的准确转换