简体   繁体   English

将AppKit与SpriteKit结合使用

[英]Using AppKit With SpriteKit

Since I've learned Objective C I've only used the SpriteKit project template. 自从学习了Objective C之后,我只使用了SpriteKit项目模板。 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. 我接触过iOS开发的经验很少,我希望在OS X SpriteKit项目中使用AppKit元素(按钮等)进行菜单创建,覆盖或在将项目放置在屏幕上方面具有更大的灵活性。 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? 是分层视图(在SKView的NSView之上)还是类似的东西?

It's basically the same as iOS. 它与iOS基本相同。 You can use NSWindowController and NSViewController to hold an SKView and place elements above the view. 您可以使用NSWindowController和NSViewController来容纳SKView并将元素放置在视图上方。

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. 就我而言,实际上我最终只对所有UI使用Sprite Kit,因为我不想管理两个单独的接口。

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. 我建议您不要使用Sprite Kit模板,而应使用默认的Cocoa App模板,因为它使用了更新的界面技术,这将使您的界面设计更容易且更类似于iOS。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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