Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
573 views
in Technique[技术] by (71.8m points)

ios - Load a .tmx (Tiled Map) in Sprite Kit?

Is there a (preferably easy) way to load a .tmx file in iOS 7's Sprite Kit? If not, are there any alternatives?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

you should use JSTileMap that is designed to work with Sprite Kit

  • add JSTileMap files to your project
  • add libz.dylib to the linked frameworks and libraries section of your project
  • import JSTileMap.h

and load a map with:

JSTileMap *tiledMap = [JSTileMap mapNamed:@"mapFileName.tmx"];
if (tiledMap) [mySKNode addChild:tiledMap];

Here is the source: https://github.com/slycrel/JSTileMap

Good Luck!!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...