The project has a countdown function. This function is easy to implement. However, it is required that the time number displayed on the page must be a special effect number produced by the artist.
This is the function for displaying FPS values in cocos2d. Find the source code in cocos2d to see how to use it. Simple
1) Name the characters required by the artist
Some articles on the Internet mentioned that the character should be placed first in the image. However, after my experiment, there is no difference between putting it in front and following. However, you must note that the width of each number, including characters, must be fixed and must be the Npower of 2. If it is an odd number, it will display unexpectedly.
2) in the code, call
Cclabelatlas * timenumber = [cclabelatlaslabelwithstring: @ "00:00" charmapfile: @ "numbers.png" itemwidth: 20 itemheight: 26 startcharmap: '0'];
Labelwithstring is the initial display status of characters.
Charmapfile is an image of the corresponding number
Itemwidth is the width of a character or number, which must be an even number.
Itemheight is the height of a character or number, preferably an even number, or a base number.
Startcharmap is the start character or number of the string. Here it is "0"
3) The content of the modified text is the same as that of cclabelttf.
[Clocklabel setstring: @ "12:56"]