SpriteKit-(SKNode)
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;
SpriteKit-(SKNode)的更多相关文章
- 文成小盆友python-num11-(2) python操作Memcache Redis
本部分主要内容: python操作memcache python操作redis 一.python 操作 memcache memcache是一套分布式的高速缓存系统,由LiveJournal的Brad ...
- 文成小盆友python-num11-(1) 线程 进程 协程
本节主要内容 线程补充 进程 协程 一.线程补充 1.两种使用方法 这里主要涉及两种使用方法,一种为直接使用,一种为定义自己的类然后继承使用如下: 直接使用如下: import threading d ...
- 我的linux学习之路--(二)linux常用命令
1.date 时间管理 电脑主板有电池,所有电脑断电时间正确,rtc linux:rtc 硬件时钟 clock/hwclock 系统时钟(linux操作系统用软件模拟震荡器计算)date看到就是 命令 ...
- MySQL数据分析-(14)表补充:字符集
大家好,我是jacky朱元禄,很高兴继续跟大家学习<MySQL数据分析实战>,本节课程jacky分享的主题是表补充之字符集 在分享课程之前,jacky在跟大家强调一下逻辑的重要性,我们学习 ...
- MySQL数据分析-(13)表操作补充:索引
大家好,我是jacky朱元禄,很高兴继续跟大家学习MySQL数据分析实战,今天跟大家分享的主题是表补充之索引: (一)前面课程的小节以及本节课程的逻辑梳理 在正式分享主题之前,jacky先跟大家捋顺一 ...
- MySQL数据分析-(12)表操作补充:字段属性
大家好,我是jacky朱元禄,很高兴继续跟大家学习MySQL数据分析实战,今天我们分享的主题是表操作补充之字段属性,依照惯例第一部分,jacky先跟大家分享本课时的学习逻辑 (一)学习逻辑 我们说创建 ...
- MySQL数据分析-(11)表补充:数据类型
大家好,我是jacky,很高兴继续跟大家学习<Mysql 数据分析实战系列教程>,上次课程jacky讲解了表层面的增删改查,jacky说最重要的是增,增就是创建表,作为一个严谨的MySQL ...
- MySQL数据分析-(8)SQL基础操作之库操作
前面我们讲了学习SQL的两个逻辑框架,jacky说了这样一个逻辑:库是为了存储表的,所以一定是先有库才有表:同样的道理,有表才有表中的数据,是吧,肯定是这个逻辑:那么,今天jacky就捋着这个逻辑从库 ...
- MySQL数据分析-(5)数据库设计之ER模型
大家好,我是jacky,很高兴跟大家分享本课时的内容,从本节课开始,就开始了我们第二章的学习,第一章我们抛出了若干问题,从第二章开始往后,都是解决问题的一个过程: 第一章的案例中,我们拿手机销售公司举 ...
随机推荐
- Problem N: 求二维数组中的鞍点【数组】
Problem N: 求二维数组中的鞍点[数组] Time Limit: 1 Sec Memory Limit: 128 MBSubmit: 2764 Solved: 1728[Submit][S ...
- 爬虫遇到HTTP Error 403的问题
# coding=gbk from bs4 import BeautifulSoup import requests import urllib x = 1 y = 1 def crawl(url): ...
- 十分钟看懂,未来Web前端开发最新趋势
首先,展望未来趋势我们就要弄懂过去的一年,也就是18年,web前端开发的重要新闻.重要事件和JavaScript的各种流行框架.模式发展趋势. 我们来快速回顾一下. NPM热门前端框架下载 先来看最热 ...
- C#:CodeSmith根据数据库中的表创建C#数据模型Model + 因为没有钱买正版,所以附加自己写的小代码
对于C#面向对象的思想,我们习惯于将数据库中的表创建对应的数据模型: 但假如数据表很多时,我们手动增加模型类会显得很浪费时间: 这个时候有些人会用微软提供的EntityFrameWork,这个框架很强 ...
- 【最大权闭合子图 最小割】bzoj1497: [NOI2006]最大获利
最大权闭合子图的模型:今天才发现dinic板子是一直挂的…… Description 新的技术正冲击着手机通讯市场,对于各大运营商来说,这既是机遇,更是挑战.THU集团旗下的CS&T通讯公司在 ...
- mysql数据库使用mybatis 插入数据时返回主键
为了体现题目,特指的是mysql,先贴上代码: <insert id="saveBizProdOrderDetail" useGeneratedKeys="true ...
- React和Vue组件间数据传递demo
一.React (一)父组件向子组件传数据 简单的向下传递参数 /* Parent */ class App extends Component { render() { return ( <d ...
- nRF52-PCA10040——Overview
Overview Zephyr applications use the nrf52_pca10040 board configuration to run on the nRF52 Developm ...
- 【转】MySQL innodb_autoinc_lock_mode 详解 ,并发插入时主键冲突的解决方案
本文转载于 http://www.cnblogs.com/JiangLe/p/6362770.html innodb_autoinc_lock_mode这个参数控制着在向有auto_increment ...
- Mysql显示某个数据库的所有表
显示表名: show tables; //先用use进入要查看表的库 mysql> use mysql; Database changed mysql> show tables; +--- ...