【COCOS2DX-游戏开发之三二】Use Custom TTF Font(官方文档)
来源:互联网 发布:linux 开启ssh服务 编辑:程序博客网 时间:2024/05/16 01:46
Now, inorder to use customer ttf font, you should do some more work. I will use TestCpp as example to describe the steps.
* Add your custom font files into your project using XCode as a resource
* Add full name of customer ttf into your application’s info.plist
* Use ttf file in codes(only use font name without directory and .ttf)
Please refer to samples/TestCpp/Classes/FontTest/FontTest.cpp for detail information.
如果传入错误的话,通过CCLabelTTF的getContentSize()来获得字符串的高度通常是错误的
* Add your custom font files into your project using XCode as a resource
* Add full name of customer ttf into your application’s info.plist
* Use ttf file in codes(only use font name without directory and .ttf)
Please refer to samples/TestCpp/Classes/FontTest/FontTest.cpp for detail information.
On iOS, use just pass font name to CCLabelTTF create an instance of CCLabelTTF. On other platforms, you should use full name.
CCLabeTTF* label = NULL;#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS) label = CCLabeTTF::create("HelloWorld", "fonts/A Damn Mess.ttf", 32);#else label = CCLabeTTF::create("HelloWorld", "A Damn Mess", 32);#endif
如果传入错误的话,通过CCLabelTTF的getContentSize()来获得字符串的高度通常是错误的
官方文档入口
0 0
- 【COCOS2DX-游戏开发之三二】Use Custom TTF Font(官方文档)
- How to Use Custom TTF Font on iOS
- COCOS2DX-游戏开发之三 坐标系
- 【COCOS2DX-游戏开发之二四】 quick-cocos2dx
- 【COCOS2DX-ANDROID-游戏开发之二三】 界面中嵌入Android的WebView
- 【COCOS2DX-ANDROID-游戏开发之二三】 界面中嵌入Android的WebView
- 【COCOS2DX-ANDROID-游戏开发之二二】之 调用Cocos2dxGLSurfaceView
- 【COCOS2DX-游戏开发之三】CCLayerMultiplex管理多个层
- 【COCOS2DX-游戏开发之二】 模态对话框
- 【COCOS2DX-ANDROID-游戏开发之二五】 调试 C++代码
- 【COCOS2DX-游戏开发之二六】 手游短连接
- 【COCOS2DX-游戏开发之二七】 坐标系(上)
- 【COCOS2DX-BOX2D游戏开发之二】 Box2d教程链接
- 【COCOS2DX-游戏开发之二九】CCEditBox的各种问题
- 【COCOS2DX-游戏开发之二六】 手游短连接
- COCOS2DX-游戏开发之 坐标系
- 【iOS-cocos2d-X 游戏开发之三】游戏存储之Cocos2dX自带CCUserDefault类详解
- Unity 自定义字体 Custom Font 原理 二
- Android4.2.2下Stagefright多媒体架构中的A31的OMX插件和Codec组件
- C++隐式指针(引用)
- uva 11645 - Bits(计数问题+高精度)
- __getattr__ VS __getattribute__
- winform抓取淘宝宝贝详细页的上下架时间等信息
- 【COCOS2DX-游戏开发之三二】Use Custom TTF Font(官方文档)
- 小朋友排列
- 用table布局的邮件如何去除td的边框
- Android添加按钮事件的几种方法
- 黑马程序员_Java基础_IO流_编码表,编码与解码
- MS SQL入门基础:创建和使用约束
- 说走就走的旅行
- 因为它极具未来感的设计一旦过目便不会轻易忘记
- how-to-load-resource-from-jar-file-packaged-in-a-war-file