我使用 CreateJS 已经有一段时间了。我在加载 Texture Packer 制作的图像时遇到了麻烦,我得到了这样的 JSON 文件:
{"frames": [
{
"filename": "aim_dot",
"frame": {"x":118,"y":4,"w":76,"h":76},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":76,"h":76},
"sourceSize": {"w":76,"h":76}
},
{
"filename": "boundary",
"frame": {"x":4,"y":385,"w":250,"h":100},
"rotated": false,
"trimmed": false,
"spriteSourceSize": {"x":0,"y":0,"w":250,"h":100},
"sourceSize": {"w":250,"h":100}
}]
}
当 Bitmap 表示这样的 Image 时:
var bitmap = new createjs.Bitmap("imagePath.jpg");
但是如果图像是图像精灵,我可以使用像 css sprite 这样的位图吗?