Title says it all. How do i use a sprite sheet in swift and sprite kit? I've searched google, stack exchange, and the apple documentation and I can't figure this one out.
相关问题
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
- SwiftUI: UIImage (QRCode) does not load after call
相关文章
- 现在使用swift开发ios应用好还是swift?
- Visual Studio Code, MAC OS X, OmniSharp server is
- UITableView dragging distance with UIRefreshContro
- Using if let syntax in switch statement
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- xcode 4 garbage collection removed?
- IntelliJ IDEA can't open projects or add SDK o
In xcode 7, you can use Images.xcassets to create a sprite atlas.
If you drag in all three image sizes with the proper suffix (@2x and @3x) it will automatically populate the images for you.
Then to use these assets in code simply write:
you can be less specific and just specify a texture:
If you're looking to use an already created sprite sheet, check out this answer on SO: Using sprite sheets in xcode.