0

I was able to create an SKTileSet on xcode but it seems like I am having a difficult time being able to init an SKTileSet with passing through a name like here:

https://developer.apple.com/documentation/spritekit/sktileset/1643819-init

This would be great to save a lot of time programmatically creating the whole set, group, rules and etc...

Thank you!

Andy Nguyen
  • 451
  • 5
  • 17
  • What did you try that didn't work? Edit your question with what you tried. Are you having trouble converting the code from Swift to Objective-C? In the link you have to the `SKTileSet init` function docs, you can choose Objective-C for the language at the top of the page to see how the `init` function is declared in Obj-C. – Swift Dev Journal Jan 27 '22 at 23:00

1 Answers1

0

You have to use the name inside the .sks file for tileSetNamed

With this setup for example:

enter image description here

You should use:

Objective-C

SKTileSet *tileSet = [SKTileSet tileSetNamed:@"Sample Tile Set"];

or Swift 5

let tileSet = SKTileSet(named: "Sample Tile Set")
Maetschl
  • 1,330
  • 14
  • 23