建立ccb文件时,有5种可供选择的类型,分别是Scene,Node, Layer,Spriter,Pariclesnode
这五种类型的区别简单来讲以下ios
Scene:是一个可供选择的场景(Scene),与你期待的也许不一样,它的根节点是CCNode,而不是CCScene。它与Node类型的主要不一样是它在SpriteBuilder种默认显示一个很好的设备框架---(翻译的很差,原文以下:it defaults to display a nice device frame around it in SpriteBuilder),(应该是说它显示整个手机设备的框架)app
Node: 本质上,和Scene相同,可是没有设备框架,它有一个CCNode类的根节点框架
Layer: 惟一一个其内容尺寸能够被设置的CCB文件类型。这使得它成为能够很好应对任意尺寸的layer(This makes it ideal for any fixed-size layer)。根节点是CCNode类型。ide
Sprite:由于sprite在游戏中太常见了,所以这个CCB类型有其本身的CCSprite做为其根节点,除了这些,它与Node类型是同样的。工具
Particles:与Sprite类型同样,除了在这里,根节点使用CCParticleSystem类。字体
Note:从技术上说,全部CCB文件类型都是能够互相内部转换的。Scene,Node, Layer的主要区别是术语的不一样和它们在SpriteBuild中是如何被显示的。Layer类型是惟一容许用户定义内容尺寸的。(接下来一段直接给原文)动画
“ Layer need only be used over Node or Scene whenever the contents need a fixed, custom size—for instance, for game levels or fixed-size overlay menus.”----当内容须要一个肯定的尺寸时,Layer才须要被使用。(摘录来自: Steffen Itterheim. “Learn SpriteBuilder for iOS Game Development”。 iBooks.)ui
Node Librarythis
左侧部分即为Node Library,其中绝大部分都是nodes,继承自CCNode,惟一的其余类型是joints,它是使用物理引擎构造的。
Node:一个可见的node,用于分组(Group)或分层(layer)其余nodes。想象它们是包含了相应内容的文件夹。这影响了画的顺序,而且在代码中访问相关内容时更简单,或者在SpriteBuilder 的 timeline中排序,移动,破坏(collapse)其余 nodes。(原文:
“This affects draw order, and it can be useful to access related items easier in code, or just to sort, move, or collapse nodes in the SpriteBuilder timeline.”摘录来自: Steffen Itterheim. “Learn SpriteBuilder for iOS Game Development”。 iBooks.)
Sub File:一个占位符,用于嵌入另外一个CCB文件。这是一个很强大的node,由于它容许你使用其余的CCB文件就像模板(templates)而且能够建立和编辑一个单独的能够被使用数次(实例化)的CCB。拖动一个CCB文件到stage会自动的建立一个Sub File Node。
Physical Node:这表明了物理世界。任何一个physical enabled(物理化)的node都必须是Physical Node的“孩子”(child)或者“孙子”(grandchild)。一般来讲,每一个scene只须要使用一个Physical Node。多重世界是能够的,可是它们的子孙将不能互相互动(“Multiple worlds are possible, but their children will not be able to interact with each other.”摘录来自: Steffen Itterheim. “Learn SpriteBuilder for iOS Game Development”。 iBooks.)
Color and Gradient Node:(颜色和梯度节点)本质上说,这些仅仅是没有图像的sprites(精灵)。它们在背景很快(quick-and-dirty backgrounds)或者做为占位符(暂时没有图片资源)时效果很好。
Sprite(精灵):2D游戏的主要组成部分。使用这个工具去画出一个单独的sprite框架。Sprite 9 Slice 能够用于为菜单屏幕或按钮建立一个可变尺寸的背景,可是由于Button Node的存在,几乎不多这么作。
Particle System(粒子系统):用于爆炸,烟雾,冒火的剑等。Particle不与物理互动,你不能够在代码中访问一个单独的Particle。相比于相等数量的Sprites,Particle动画的效率很高。
Label TTF and BM-Font:用于文本,TTF表明Truetype Font。优点在于你可使用任何内置的ios或者通用的TTF字体。不利在于每个文本中的变化都内在的建立了一个新的textture。
Button:一个Button是Sprite 9 Slice(background image)和Label TTF(text)的组合(ultimate combination)。能够在代码中增长处理。
Text Field:一个可编辑的Label。用户能够点击并输入文本,你的代码中能够接受到message,当每一次结束编辑或文本改变时。
Slider(滑动条 滚动条):左右方向的。技术上说,它的操做值永远在0.0到1.0之间。
Sroll View:
“ Despite its name, this is not meant to create scrolling game worlds. It’s intended to be dragged and moved by the user and to create a scrolling and snapping effect similar to the one used for browsing photos in the Photo library. You’ll later use a Scroll View to create a level selection screen.
”
摘录来自: Steffen Itterheim. “Learn SpriteBuilder for iOS Game Development”。 iBooks.
Box Layout:
“Makes the tedious task of evenly spacing nodes a snap. You can align its child nodes horizontally or vertically, but alas, despite its name you cannot align them on a grid with multiple rows and columns by itself. However, you can use a horizontal Box Layout that contains multiple vertical Box Layout nodes as children, each of which contains the nodes in each column—or vice versa, with the horizontal and vertical alignment Box Layout nodes swapped.”
摘录来自: Steffen Itterheim. “Learn SpriteBuilder for iOS Game Development”。 iBooks.
(未完待续)