CocosBuilder用户手册中文版:7. Automatic Scaling and Sprite Sheets copy

Automatic Scaling and Sprite Sheets

自动缩放和精灵表

CocosBuilder can manage your assets and automatically scale them for different devices and resolutions. It can even create and scale the sprite sheets for you.
CocosBuilder可以管理你的资产,并为不同的设备和分辨率自动缩放它们。他甚至为你创建和缩放精灵表。

Automatic Scaling

自动缩放

To have CocosBuilder automatically scale your assets, first set your design resolution in your “Publish Settings”. CocosBuilders reference scale is the original iPhone resolution (equals 1x). By default images will automacially be scaled down from a design resolution of 4x, or the iPad retina display. You can change this, but keep in mind that using a lower resolution can force CocosBuilder to scale up images, which will make them look bad on high resolution devices. In the publish settings you can also choose which resolutions you want to export your images and sprite sheets to.

为了使CocosBuilder自动缩放你的资产,首先设置“文件->发布设置”中设置你的设计分辨率,CocosBuilder参考的缩放是原始的iPhone分辨率(等于1倍)。默认的图像将会被从4倍的设计分辨率自动缩放, 或iPad视网膜显示屏。你可以对此进行修改,但是要记住,使用一个低分辨率可以强制CocosBuilder放大图像,这会使他们在高分辨率的设备上看起来很糟。 在“发布设置”中,还可以选择将要导出的你的图片和精灵表的分辨率。






For the automatic scaling to work you will need to tell CocosBuilder that the images are in design resolution. You do this by putting the images in a sub-directory named *resources-auto*. Even though the resources are in the sub-directory, CocosBuilder will show them as being in it's original folder.

为了使自动缩放工作,你需要告诉CocosBuilder图像的设计分辨率。通过将图像放入到名为“resources-auto”的子目录来达到目的。虽然这些资源在子目录中,CocosBuilder将显示他们在原始的文件夹中。





If you are not happy with the automatic scaling for some of the resources, it's always possible to override it. Simply create a directory next to the *resources-auto* directory and name it after the resolution you want to override. The images that you put in this directory will override any images in the *resources-auto* directory. E.g. to override images for iPhone retina devices, name the directory *resources-iphonehd*.

如果你对自动缩放某些资源并不满意,始终可以重写它。简单的创建一个目录在resources-auto目录旁边,并用你想要重写的分辨率命名它。在这个目录中的图像将会重写”resources-auto"目录中的任何图像。例如:为iPhone视网膜设备重写图像资源,就命名目录为“resources-iphonehd”


Smart Sprite Sheets

智能精灵表

CocosBuilder can quickly turn a directory of images into a sprite sheet. To do this, simply right click the directory in the *Project* view and select *Make Smart Sprite Sheet*. The directory should only contain images (and optionally sub-directories for different resolutions or automatic scaling as described above).

CocosBuilder可以快速的转换图像目录到一个精灵表。要做这件事,简单的右键单机目录在项目(Project)视图中,并选择”制作智能精灵表“。这个目录需要只包含图像(还有像上面描述的,为不同分辨率或者自动缩放而准备的子目录)。






The folder will turn pink and have a happy smiley face to indicate that it is a smart sprite sheet. To edit the properties of the sprite sheet, right click it again and select *Edit Smart Sprite Sheet…*. You can choose from a selection of output formats, compression and dithering. Dithering will only be used for lossy compression pvr formats. HTML 5 still doesn't support pvr textures, therefore PNG images will be exported for HTML 5 regardless of settings.

文件夹将会变为粉色,并且有一个高兴的笑脸来指示它是一个只能精灵表。通过再次右键单击它,并选择”编辑只能精灵表...“来编辑精灵表的属性。你可以选择输出的格式、压缩和抖动方式。 抖动将只被用于无所压缩PVR格式。HTML 5 仍然不支持PRV贴图,因此,将会为HTML 5到处PNG,而不管如何设置。



If you need to access the smart sprite sheet's images from code, the name of the sprite sheet will be the name of the directory with the *.plist* extension added. The names of the sprite frames will be the name of the full path to the image, including the directories that it is in (but excluding any resource specific directories, such as *resources-auto*).

如果你需要从代码中访问智能精灵表的图像,精灵表将会被命名为"[目录].plist". 精灵帧们将会被命名为图像的完全路径,包括他们所在的目录(但不包括任何资源特定的目录,比如"resources-auto").



Sound Conversions

声音转换

Sounds needs to be saved in different formats for different platforms to play back optimally. CocosBuilder conveniently handles this for you. To use the automatic conversion feature, make sure that all your sound effects are saved in *wav* format. Longer sounds, such as background music should be saved in *mp3* format. When the sounds are published they will be converted to suitable formats for the different platforms.

声音需要为不同的平台存储为不同的格式进行最佳回放. CocosBuilder方便的为你处理这件事.为了使用自动转换功能,确保你的全部音效存储为"wav"格式.较长的声音,比如背景音乐,需要存储为".mp3"格式.当声音被发布后,他们将会为不同的平台转换为合适的格式.

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值