码迷,mamicode.com
首页 > 其他好文 > 详细

SpriteKit 学习体会贴(不断完善中)

时间:2017-01-20 13:07:24      阅读:170      评论:0      收藏:0      [点我收藏+]

标签:bug   使用   can   mat   style   rman   ring   class   sprite   

1. 关于 SKShapeNode

刚接触SpriteKit时,看到这个类,以为它会比SKSpriteNode更为轻量级,但其实不是:

Shape nodes are useful for content that cannot be easily decomposed into simple textured sprites. Shape nodes are also very useful for building and displaying debugging information on top of your game content. However, the SKSpriteNode class offers higher performance than this class, so use shape nodes sparingly.

其实是SKSpriteNode有更高的效率。

这里提到了SKShapeNode的使用场景:Shape nodes are useful for content that cannot be easily decomposed into simple textured sprites. 这句话怎么理解呢?

我们看一看官方文档用SKShapeNode实现的效果图:

技术分享

技术分享

技术分享

技术分享

上面这4附图,都是用ShapeNode绘制出来的。我是这样理解的,当你需要利用opengl函数绘制一些内容时,可以使用ShapeNode,否则应该使用SpriteNode。

SpriteKit 学习体会贴(不断完善中)

标签:bug   使用   can   mat   style   rman   ring   class   sprite   

原文地址:http://www.cnblogs.com/breezemist/p/6322299.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!