cocos2d-x 라이브러리에서 찾은 파일에는 FPS 이미지의 16 진수 형식 배열 인 ccFPSImage.c라는 파일이 있습니다. Cocos2D-x는 FPS를 표시하는 데 사용합니다.cocos2d-x에서 ccFPSImage.c 파일을 생성하는 방법
나는 그 파일을 어떻게 생성 할 수 있는지 알고 싶다.
unsigned char cc_fps_images_png[] = {
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x03, 0xe7, 0x00, 0x00, 0x00, 0x36,
0x08, 0x06, 0x00, 0x00, 0x00, 0xa5, 0x74, 0xe8, 0xab, 0x00, 0x00, 0x0a,
0x41, 0x69, 0x43, 0x43, 0x50, 0x49, 0x43, 0x43, 0x20, 0x50, 0x72, 0x6f,
0x66, 0x69, 0x6c, 0x65, 0x00, 0x00, 0x48, 0x0d, 0x9d, 0x96, 0x77, 0x54,
0x53, 0xd9, 0x16, 0x87, 0xcf, 0xbd, 0x37, 0xbd, 0xd0, 0x12, 0x22, 0x20,
.... (There are a lot of hex values here, I just omit them here)
}
나는 .H 파일을 생성 ImageMagick이 도구를 사용하여,하지만이로드 될 때, 그냥보고 :
cocos2d: the file is not a dds file!
cocos3d: the file is not a ktx file!
Image WARNING: unsupport true color tga data pixel format. FILE:
Fails: init fps_images
cocos2d: the file is not a dds file!
cocos3d: the file is not a ktx file!
Image WARNING: unsupport true color tga data pixel format. FILE:
Fails: init fps_images
cocos2d: the file is not a dds file!
cocos3d: the file is not a ktx file!
Image WARNING: unsupport true color tga data pixel format. FILE:
Fails: init fps_images
내가 사용
파일의 내용은 다음과 같이이다 다음 명령을 사용하여 .h 파일을 생성하십시오.
convert fps.png h:->fps.h
유효한 ccFPSImage.c 파일 이자형?
감사합니다.
"data/file to .h"변환기가 작업을 수행 할 수 있습니다. – LearnCocos2D
@ LearnCocos2D 예를 들어 주시겠습니까? MacOSX를 사용하고 있습니다. – zilongshanren
https://www.google.de/search?q=file+to+.h+converter&ie=UTF-8&oe=UTF-8&hl=en&client=safari#hl=en&q=file+to+c+header+converter – LearnCocos2D