Working with Other Node Types
【Working with Other Node Types】
【Shape Nodes Draw Path-Based Shapes】
The SKShapeNode class draws a standard Core Graphics path.
You can see from the code that the shape has three essential elements:
- The interior of the shape is filled. The fillColor property specifies the color used to fill the interior.
- The outline of the shape is rendered as a line. The strokeColor and lineWidth properties define how the line is stroked.
- A glow extends from the outline. The glowWidth and strokeColor properties define the glow.
【A Video Node Plays a Movie】
The SKVideoNode class uses the AV Foundation framework to display movie content.
【Emitter Nodes Create Particle Effects】
When an SKEmitterNode object is placed in a scene, it automatically creates and renders new particles. You use emitter nodes to automatically create special effects, including rain, explosions, or fire.
A particle is similar to an SKSpriteNode object; it renders a textured or untextured image that is sized, colorized, and blended into the scene. However, particles differ from sprites in two important ways:
- A particle’s texture is always stretched uniformly.
- Particles are not represented by objects in Sprite Kit. This means you cannot perform node-related tasks on particles, nor can you associate physics bodies with particles to make them interact with other content.
Particles are purely visual objects, and their behavior is entirely defined by the emitter node that created them. The emitter node contains many properties to control the behavior of the particles it spawns, including:
- The birth rate and lifetime the particle. You can also specify the maximum number of particles that are spawned before the emitter turns itself off.
- The starting values of the particle, including its position, orientation, color, and size. These starting values are typically randomized.
- The changes to apply to the particle over its lifetime. Typically, these are specified as a rate-of-change over time. For example, you might specify that a particle rotates at a particular rate, in radians per second. The emitter automatically updates the particle data each frame. In most cases, you can also create more sophisticated behaviors using keyframe sequences. For example, you might specify a keyframe sequence for a particle so that it starts out small, scales up to a larger size, then shrinks before dying.
【Use the Particle Emitter Editor to Experiment with Emitters】
内置Particle模板,如下,通过File->Resource->SpriteKit Particle 来添加内置模板到应用程序。
Inspector中可以修改Particle效果,立即生效。
Particle Textrue用于修改粒子使用的texture,如下面两图使用了不同的ParticleTexture,
Setting the Number of Particles Created
Setting a Particle’s Life Expectancy
Working with Other Node Types的更多相关文章
- Working with Other Node Types II
[Working with Other Node Types II] An SKCropNode object does not directly render content, like a spr ...
- tbb flow graph node types
- XML DOM 节点类型(Node Types)
节点类型 下面的表格列出了不同的 W3C 节点类型,以及它们可拥有的子元素: 节点类型 描述 子元素 Document 表示整个文档(DOM 树的根节点) Element (max. one) Pro ...
- 创建Node.js TypeScript后端项目
1.安装Node.js扩展,支持TypeScript语法 npm install -g typescript npm install -g typings 2.创建项目目录project_fold ...
- union 类型(即sum types)在golang语言中的实现
http://www.jerf.org/iri/post/2917 Sum Types in Go posted Jun 02, 2013 in Programming, Golang, Haskel ...
- [转]XML中元素(Element)与节点(Node)的区别
前言: element是特殊的node 一段纯文本即text-node也是node 但不是element w3c的原话是 A node can be an element node, an attri ...
- 前端使用express+node实现接口模拟及websocket通讯
简述如何使用node+express实现接口连接及入门websocket通讯.使用技术栈:node + express + typescript + websocket. 1.接口实现 这里描述前端如 ...
- MongoDB 搭建Node.js开发环境
理解Mongoose Elegant MongoDB object modeling for Node.js 安装Mongoose $ cnpm install --save mongoose ...
- 搭建Node.js Redis开发环境
创建项目 初始化为node项目 $npm init 安装redis 安装@types/node, @types/redis, typescript 初始化TypeScript 配置ts ...
随机推荐
- CSS控制背景
一.设置背景颜色:background-color 十六进制 background-color:#ff0000; 英文名称 background-color:red; 三原色 background-c ...
- UVa (BFS) The Monocycle
题目不光要求要到达终点而且要求所走的步数为5的倍数,每个时刻有三个选择,前进,左转弯,右转弯. 所以在vis数组中新增加两个维度即可,vis[x][y][dir][color]表示在(x, y)格子方 ...
- 01.C语言关于结构体的学习笔记
我对于学习的C语言的结构体做一个小的学习总结,总结如下: 结构体:structure 结构体是一种用户自己建立的数据类型,由不同类型数据组成的组合型的数据结构.在其他高级语言中称为记录(record) ...
- POJ 1422 Air Raid (最小路径覆盖)
题意 给定一个有向图,在这个图上的某些点上放伞兵,可以使伞兵可以走到图上所有的点.且每个点只被一个伞兵走一次.问至少放多少伞兵. 思路 裸的最小路径覆盖. °最小路径覆盖 [路径覆盖]在一个有向图G( ...
- Java 动态眨眼 EyesJPanel (整理)
/** * Java 动态眨眼 EyesJPanel (整理) * * 2016-1-2 深圳 南山平山村 曾剑锋 * 注意事项: * 1.本程序为java程序,同时感谢您花费宝贵的时间来阅读本文档: ...
- nodejs开发阶段利器supervisor
在开始学习nodejs时,往往一般写代码,一边看效果.先停止node,再重新运行.非常耗时. 这时supervisor派上了用场. 安装 推荐使用npm,本人一直使用局部安装,这样可以将全部文件安装在 ...
- Android设计模式之策略模式
今天介绍下策略模式,直接先上UML图 策略模式的概念 The Strategy Pattern defines a family of algorithms,encapsulates each one ...
- linux下的加减运算
命令: echo rep 如果你有些编程方面的概念,最有意思的是用gdb,它可以进行进制转换,浮点数运算,数据类型占用字节数等等,很方便. (gdb) p 2+5$21 = 7(gdb) p 2/5$ ...
- B-树和B+树
B-树和B+树是一种平衡的多路查找树,它在文件系统中很有用.一颗m阶的b-树,或为空树,或满足下列特性的m叉树.1)树中每个节点至多有m棵子树2)若根结点不是叶子结点,则至少有两棵子树.3)除根之外的 ...
- [转]几个开源的.net界面控件
转自原文 几个不错的开源的.net界面控件,介绍几个自己觉得不错的几个开源的.net界面控件. DockPanel Suite:开发类似VS.net的界面,#Develop就是使用的这个控件. 网址: ...