TomLinthwaite / SKTilemap

An addition to Apples Sprite Kit frame work for iOS & OSX which allows for the creation of tilemaps either programmatically or from a .tmx file (created in Tiled). SKTilemap is written purely in Swift and sets out to be a simple solution for all game programmers alike to add tilemaps to their Sprite Kit games.
MIT License
57 stars 18 forks source link

Swift 3 #13

Open ravenshore opened 8 years ago

ravenshore commented 8 years ago

Hi, m8

just wanted to see if you have already tried this on Xcode8 and Swift 3. I am getting an error on loading the map, but can't figure it out why.

riklowe commented 8 years ago

whats the error ?

I have it working on Xcode 8 / Swift 3.0

ravenshore commented 8 years ago

Here is what I got, it fails to load the map for some reason. http://prntscr.com/blbfjc http://prntscr.com/blbfjc

TomLinthwaite commented 8 years ago

Hi. So this is an issue either with the file not being found or some problem during parsing the xml inside the .tmx file. Check that your tilemap is actually linked to your project. Also check that you haven't put your tilemap inside a folder and used a folder reference, that might mess it up also. If you want it in a folder add the folder as a group when you add it to the project. The tmx xml should be fine unless you've hand edited it or maybe it got corrupted some how? Does the map load in Tiled?

ravenshore commented 8 years ago

I was just thinking of importing one of my maps, but now Xcode is telling me there are 102 more errors to fix. I installed your project 3 times now. First got converted to Swift 3.0 and it looked OK, only a few things for me to fix, but then the error you saw. The other 2 got converted and come up with 100+ fixes needed... I ma guessing the converter didn't do it all, despite Xcode was telling me so...

ravenshore commented 8 years ago

How much work did the converter for you ?

TomLinthwaite commented 8 years ago

To be honest I haven't even tried to convert it. I'll have a go in a minute and create a new branch for swift 3 for the time being.

ravenshore commented 8 years ago

Ok, was able to finish converting it. It's working fine now, also had to delete all my provisioning profiles as they seemed to messed up my Xcode somehow... Thanks!

ravenshore commented 8 years ago

Btw, did you figure out how to remove the black lines when zooming in/out ? Occasionally mine would stay on the screen, but I remember that was gone last time I tested on Xcode 7.

TomLinthwaite commented 8 years ago

Glad its working for you. I just converted it but still have some strange behaviour. The simulator won't switch to landscape for some reason and the touchesBegan method is never fired for a single touch. It works if I zoom though... Too tired to look into it now but if anyone has any ideas I'm all ears. I'll upload what I have since it seems to be working, it is beta after all :P

ravenshore commented 8 years ago

I have it fully working on Swift 3.0 Let me know if you want me to upload it for you on GH.

TomLinthwaite commented 8 years ago

You have the full example project working? If so yea create a pull request and I'll test it. If it works I'll merge it thanks :)

ravenshore commented 8 years ago

It wouldn't let me submit the pull request, I just uploaded another repo, so you can just clone, test and then manually merge if you want: https://github.com/ravenshore/SKTilemap-master-2

TomLinthwaite commented 8 years ago

Sorry for getting back to you so late. I downloaded your project and I still have the issues I stated above which is weird :/ The beta is so unstable at the moment I think it's best we wait until another release and things get better before committing anything.

ghost commented 7 years ago

Hi Guys,

I have not seen this before so I did the Swift3 switch as well and submitted a pull request. I added also a fix for loading the sprite sheets correctly.

@TomLinthwaite : If you managed to get everything from @ravenshore pull request, please reject my request and I will update and re-issue with the missing changes.