使用 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 的平铺贴图时,如何避免对视网膜的双重努力的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

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

基础教程推荐