Swift SpriteKit 中使用 FontAwesome
来源:互联网 发布:手机淘宝秒杀在哪里 编辑:程序博客网 时间:2024/05/16 16:01
Swift SpriteKit 中使用 FontAwesome
1. FontAwesome.otf加入xCode
直接从Finder中把fontAwesome.otf文件拖入xCode项目下。
2. Copy Bundle Resource
在project->build里面,设置copy bundle resource。
3. 加入plist
4. 获取Font名称
override func didMove(to view: SKView) { for family: String in UIFont.familyNames { print("\(family)") for names: String in UIFont.fontNames(forFamilyName: family) { print("== \(names)") } } }
5. 使用字体
public struct FontAwesome { static let fiveHundredPixels = "\u{f26e}" static let adjust = "\u{f042}" static let adn = "\u{f170}" static let alignCenter = "\u{f037}" static let alignJustify = "\u{f039}" static let alignLeft = "\u{f036}" static let alignRight = "\u{f038}" static let amazon = "\u{f270}" static let ambulance = "\u{f0f9}" ...}let levelMenu = SKLabelNode(fontNamed: "FontAwesome")levelMenu.text = FontAwesome.applelevelMenu.fontColor = UIColor.whitelevelMenu.fontSize = 32levelMenu.position = CGPoint(x:30,y:5*menuCellHei + (menuCellHei-32)/2)menuNode.addChild(levelMenu)
0 0
- Swift SpriteKit 中使用 FontAwesome
- Android中使用FontAwesome
- android中使用fontawesome
- Axure中使用FontAwesome字体
- Axure中使用图标字体【FontAwesome】
- WordPress插件 | 在WordPress中使用FontAwesome
- 使用Swift和SpriteKit写一个忍者游戏
- flappybird + swift + spriteKit
- 初探 Swift SPriteKit
- 如何在安卓app中使用FontAwesome图标
- 如何在安卓app中使用FontAwesome图标
- 在安卓项目中使用FontAwesome图标
- 如何在安卓app中使用FontAwesome图标
- 如何在 Android 应用中使用 FontAwesome 图标
- 如何在 Android 应用中使用 FontAwesome 图标
- 在 Windows Forms 和 WPF 应用中使用 FontAwesome 图标
- 在 Windows Forms 和 WPF 应用中使用 FontAwesome 图标
- 在 Windows Forms 和 WPF 应用中使用 FontAwesome 图标
- 实现多线程断点下载可以运行
- A*算法程序
- Ora-12518 TNS:监听程序无法分发客户机
- AngularJS 指令
- 洛谷1040加分二叉树
- Swift SpriteKit 中使用 FontAwesome
- Easy 8题 String to Integer (atoi)
- AngularJS ng-model 指令
- 关于socket编程 第一节 认识socket编程
- sizeof小程序
- Bootstrap维护者宣布停止v3版本的更新(附逐浪官方镜像)
- 1.matlab中的通用命令
- 大数据平台--存储方向
- 营养与铁