2014年7月15日

在Swift中整数以及浮点的格式化

摘要: 1 整数的格式化有的时候我们需要将整数输出为类似01,02,001,002这样的格式。那么在swift中我们可以这样写let i=3let str = String(format:"%.2d",i)println("\(str)") //输出为032 保留多少位小数有时候我们需要将3.3333保留... 阅读全文

posted @ 2014-07-15 11:11 老镇 阅读(5979) 评论(0) 推荐(0) 编辑

Swift游戏实战-跑酷熊猫 02 创建熊猫类

摘要: 要点:如何继承SKSpriteNode :子类必须调用SKSpriteNode的一个指定构造器init(){ super.init(texture:texture,color:UIColor.whiteColor(),size:size)}设置场景的背景颜色:self.backgroundColo... 阅读全文

posted @ 2014-07-15 09:37 老镇 阅读(1770) 评论(0) 推荐(2) 编辑

导航