1.初始化

+ (instancetype)node;

+ (nullable instancetype)nodeWithFileNamed:(NSString*)filename;

2.返回边界边框

- (CGRect)calculateAccumulatedFrame;

3.坐标

//节点的父节点的位置坐标系统
@property (nonatomic) CGPoint position;
//z值的节点(用于排序)。负z是”到“屏幕,正面屏幕的z是“出去”。更大的zPosition将面前的一个较小的zPosition排序。
@property (nonatomic) CGFloat zPosition;
//绕z轴旋转(弧度)
@property (nonatomic) CGFloat zRotation;
//x比例
@property (nonatomic) CGFloat xScale;
//y比例
@property (nonatomic) CGFloat yScale;

4.一些属性

//速度
@property (nonatomic) CGFloat speed;
//透明度
@property (nonatomic) CGFloat alpha;
//控制节点的行为是否更新或暂停
@property (nonatomic, getter = isPaused) BOOL paused
//是否隐藏
@property (nonatomic, getter = isHidden) BOOL hidden;
//控制节点是否接收触摸事件
@property (nonatomic, getter=isUserInteractionEnabled) BOOL userInteractionEnabled;
//父节点
@property (nonatomic, readonly, nullable) SKNode *parent;
//子节点
@property (nonatomic, readonly) NSArray<SKNode*> *children;
//节点名称
@property (nonatomic, copy, nullable) NSString *name;
//节点所在的场景
@property (nonatomic, readonly, nullable) SKScene* scene;
//物理身体连接的节点,同步,旋转,和地位
@property (nonatomic, retain, nullable) SKPhysicsBody *physicsBody;
//一个可选的字典,可用于您自己的数据存储在一个节点。默认为零。
@property (nonatomic, retain, nullable) NSMutableDictionary *userData;
//运动学约束,用于解决本土知识
@property (nonatomic, copy, nullable) SKReachConstraints *reachConstraints;
//可选的一系列SKConstraints和物理约束是评估每一帧后操作。节点的转换将被改变,以满足约束条件。
@property (nonatomic, copy, nullable) NSArray<SKConstraint*> *constraints;

5.设置x,y的大小

- (void)setScale:(CGFloat)scale;

6.添加删除,移动,遍历精灵

- (void)addChild:(SKNode *)node;

- (void)insertChild:(SKNode *)node atIndex:(NSInteger)index;

- (void)removeChildrenInArray:(NSArray<SKNode*> *)nodes;
- (void)removeAllChildren; - (void)removeFromParent;
- (void)moveToParent:(SKNode *)parent; - (nullable SKNode *)childNodeWithName:(NSString *)name; - (void)enumerateChildNodesWithName:(NSString *)name usingBlock:(void (^)(SKNode *node, BOOL *stop))block;

7.如果有父节点

- (BOOL)inParentHierarchy:(SKNode *)parent;

8.运行动作,获取动作,移除动作

- (void)runAction:(SKAction *)action;
- (void)runAction:(SKAction *)action completion:(void (^)())block;
- (void)runAction:(SKAction *)action withKey:(NSString *)key; - (BOOL)hasActions;
- (nullable SKAction *)actionForKey:(NSString *)key; - (void)removeActionForKey:(NSString *)key;
- (void)removeAllActions;

9.填写坐标返回上面的精灵

- (BOOL)containsPoint:(CGPoint)p;

- (SKNode *)nodeAtPoint:(CGPoint)p;

- (NSArray<SKNode*> *)nodesAtPoint:(CGPoint)p;

10.移动精灵

- (CGPoint)convertPoint:(CGPoint)point fromNode:(SKNode *)node;
- (CGPoint)convertPoint:(CGPoint)point toNode:(SKNode *)node;

11.插入精灵

- (BOOL)intersectsNode:(SKNode *)node;

12.两个精灵是否相同

- (BOOL)isEqualToNode:(SKNode *)node;

13.GKPolygonObstacle

/* Returns an array of GKPolygonObstacles from a group of SKSpriteNode's textures in scene space. For use with GPObstacleGraph in GameplayKit */
+ (NSArray<GKPolygonObstacle*> *)obstaclesFromSpriteTextures:(NSArray<SKNode*>*)sprites accuracy:(float)accuracy; /* Returns an array of GKPolygonObstacles from a group of SKNode's transformed bounds in scene space. For use with GPObstacleGraph in GameplayKit */
+ (NSArray<GKPolygonObstacle*> *)obstaclesFromNodeBounds:(NSArray<SKNode*>*)nodes; /* Returns an array of GKPolygonObstacles from a group of SKNode's physics bodies in scene space. For use with GPObstacleGraph in GameplayKit */
+ (NSArray<GKPolygonObstacle*> *)obstaclesFromNodePhysicsBodies:(NSArray<SKNode*>*)nodes;

14,获取触碰精灵的位置

- (CGPoint)locationInNode:(SKNode *)node;

最新文章

  1. 原生JS投票特效
  2. delphi实现的RTMP播放
  3. wex5 教程 之 图文讲解 登陆,注册,页面跳转
  4. location.reload()加载时有弹出框
  5. struts2 笔记03 异常支持、防止页面刷新和后退、方法验证
  6. 忘记 oracle11g 的 sys 密码的处理
  7. include&lt;stdio.h&gt; 和include&lt;iostream.h&gt;的区别
  8. 使用node js 操作 Mysql 数据库
  9. POJ 3169 Layout (差分约束)
  10. POJ 1502 MPI Maelstrom (最短路)
  11. 关于FileOutputStream的问题
  12. ppss
  13. 关于JAVA面向对象基础整理以及个人的理解(适合初学者阅读)
  14. angularjs 实现排序功能
  15. Java 9 揭秘(2. 模块化系统)
  16. Gym 100952E&amp;&amp;2015 HIAST Collegiate Programming Contest E. Arrange Teams【DFS+剪枝】
  17. FJUT16级第一周寒假作业题解J题
  18. Python面向对象——基本继承
  19. tarjan——cogs 1298 通讯问题
  20. Netty中解码基于分隔符的协议和基于长度的协议

热门文章

  1. ueditor1_3_6 一点问题记录
  2. UVA 211 The Domino Effect 多米诺效应 (回溯)
  3. 【转】树莓派3代3.5寸触摸屏驱动的安装(通过ssh安装)
  4. iframe的document操作
  5. Python 消息框的处理
  6. 如何在 JavaScript 中更好地使用数组
  7. Unity基础-编辑器
  8. LeetCode1089复写零
  9. 老男孩Python高级全栈开发工程师三期完整无加密带课件(共104天)
  10. idea 关于高亮显示与选中字符串相同的内容踩过的坑