简体   繁体   中英

Using AppKit With SpriteKit

Since I've learned Objective C I've only used the SpriteKit project template. I've had a tiny bit of exposure to iOS development and I'm looking to use AppKit elements (buttons, etc) in an OS X SpriteKit project for menu creation, overlays or having more flexibility in terms of placing items on the screen. Is this possible and if so, how? Would it be something along the lines of layering views (NSView overtop of an SKView) or something like that?

It's basically the same as iOS. You can use NSWindowController and NSViewController to hold an SKView and place elements above the view.

In my case I actually just ended up using Sprite Kit for all of the UI because I didn't want to have to mange two separate interfaces.

I recommend that you don't use the Sprite Kit template but instead use the default Cocoa App Template because it uses newer interface technologies that will make designing your interface easier and more similar to iOS.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM