Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yulingtianxia/nodescoordinates
SpriteKit坐标系
https://github.com/yulingtianxia/nodescoordinates
Last synced: 25 days ago
JSON representation
SpriteKit坐标系
- Host: GitHub
- URL: https://github.com/yulingtianxia/nodescoordinates
- Owner: yulingtianxia
- Created: 2014-05-04T12:14:03.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-08-16T10:22:15.000Z (about 10 years ago)
- Last Synced: 2024-10-09T09:02:55.182Z (about 1 month ago)
- Language: Objective-C
- Size: 359 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
NodesCoordinates [![Build Status](https://travis-ci.org/yulingtianxia/NodesCoordinates.svg?branch=master)](https://travis-ci.org/yulingtianxia/NodesCoordinates)
================SpriteKit坐标系
为了测试SpriteKit中SKNode及其子类而写的小程序
主要逻辑都在Button类,通过组合的方式加入了SKNode和SKSharpNode对象,用来绘制在正中央的Node和其原点
运行后看到屏幕下方有五行字,好吧也是五个按钮,按一下显示对应的Node,再按一下擦除
这五个Button都继承自Button类,便于拓展,通过类名构造对象的代码如下:
```
- (id) createInstanceByClassName: (NSString *)className {
Class aClass = NSClassFromString(className);
id anInstance = [[aClass alloc] init];
return anInstance;
}
```Button类中还加了个original协议作为代理,其实也没多大用处,只是考虑为了以后拓展复用代码方便而已
对应文章地址:http://yulingtianxia.com/blog/2014/05/04/spritekitzuo-biao-xi/