"Independent Developer ER cocos2d-x combat 008" Bmfont generate bitmap Font tool and COCOS2DX use load Fnt file

Source: Internet
Author: User

1, first we need to download and install the Bmfont tool, as follows: http://download.csdn.net/detail/chenqiai0/8899353 (there are detailed the use of the document, if the use of what do not understand please leave a message). 2 , after installation, open Bmfont, the interface is as follows, the list on the right is the font library 3. Create a TXT file and enter the text you use ( Note: Use Utf-8 when saving, otherwise the software will not be recognized )


4, the next operation please download the above resources, and then follow the steps in the PDF, you can certainly achieve the export of fnt files.
Note: It is important to note that the path does not contain Chinese when the file is exported, which may be bmfont for other reasons.
After exporting the file, you will find a fnt file and a PNG file in the save path (this is similar to the plist file saving jigsaw information) and copy them to fonts under the resources directory of the COCOS2D-X project:
Then create a new COCOS2DX project and add the following code:
<span style= "Font-weight:normal;" >cclabelbmfont *labelbmfont = Cclabelbmfont::create ("Independent Developer ER", "fonts\\a.fnt"); Labelbmfont->setposition (CCP ( VISIBLESIZE.WIDTH/2, visiblesize.height-100)); AddChild (labelbmfont,1);</span>


Reference Blog:
http://blog.csdn.net/chenqiai0/article/details/46866745
http://blog.csdn.net/keshuiyun/article/details/9960589
http://blog.csdn.net/aa4790139/article/details/8113197
http://blog.csdn.net/keshuiyun/article/details/9960667
http://book.51cto.com/art/201504/473605.htm (Bmfont export parameter for details, please refer to this blog)

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

"Independent Developer ER cocos2d-x combat 008" Bmfont generate bitmap Font tool and COCOS2DX use load Fnt file

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.