使用 Tiled 和 Cocos2d 的平铺贴图时,如何避免对视网膜的双重努力

How to avoid a double-up of effort for retina, when using tile maps from Tiled with Cocos2d(使用 Tiled 和 Cocos2d 的平铺贴图时,如何避免对视网膜的双重努力)
本文介绍了使用 Tiled 和 Cocos2d 的平铺贴图时,如何避免对视网膜的双重努力的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I've got retina tile maps working, 15x10 tiles, of 64x64 tiles. problem is for non-retina devices I will need to make a 15x10 tiles of 32x32 tiles. I don't want to recreate the Tile, is it just a case of changing the XML (.tmx) file? Is there an automated tool or another way around this? I've been looking online but not getting too much help.

Thanks

解决方案

You have to update the TMX file and scale certain attributes. Unless your TMX map is very simple this will be a tedious and error-prone task that's best left to a tool.

There are a variety of TMX rescaling tools out there, but some didn't work for me or simply were incomplete at the time (ie one didn't scale object layers). All the tools I know are generally are written in rather unusual languages (for an iOS developer at least) like Python, Ruby or Bash scripts. Others are only available as binary without the source code.

Check out this cocos2d forum post. Specifically this tool or HDx on the App Store. iTilemaps might also work for you.

Because I wasn't happy with either of the choices, I wrote my own command line tool tmx2scale in Objective-C to rescale TMX maps intelligently in all directions. The tmx2scale tool is not currently available but it will be distributed complete with source code with the KoboldScript Game Kit project.

这篇关于使用 Tiled 和 Cocos2d 的平铺贴图时,如何避免对视网膜的双重努力的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

How to stop UIBarButtonItem text from truncating?(如何阻止UIBarButtonItem文本被截断?)
java.lang.IllegalStateException: SimpleTypeImpl should not be created for error type(异常:不应为错误类型创建SimpleTypeImpl)
Android IllegalArgumentException: The tag for fragment_XXX is invalid. Received: layout-sw600dp/fragment_XXX_0(Android IlLegalArgumentException:Fragment_XXX的标签无效。收到:Layout-sw600dp/Fragment_XXX_0)
NSURLSessionTaskPriority seems to be ignored?(NSURLSessionTaskPriority似乎被忽略了?)
How to make dataWithEPSInsideRect vector rather than bitmap in vector format?(如何用EPSInside Rect将dataWithEPSInside Rect变成矢量而不是位图的矢量格式?)
HTTPS request using volley(使用 volley 的 HTTPS 请求)