问题标签 [kobold-kit]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
ios - iOS how to achieve UIButton's like behavior for nodes in Sprite Kit?
I would like some of my Sprite Kit nodes to behave like UIButtons. I tried 2 approaches:
1) Use touchesBegan:
- this works if a user is careful, but seems to fire multiple times, faster than I can disable interaction, resulting in a button being able to be activated multiple times:
2)I switched to Kobold-Kit as a layer on top of iOS Sprite Kit. One of the things it allows me to do is add button - like behavior to any node. However, I'm running into an issue where a if I have 2 buttons stacked on top of each other, tapping the top button activates both. Boolean flags can prevent repeated interactions in this case. I tracked the issue of stacked buttons firing together to this call within KKScene:
The scene simply sends notifications to all nodes within the scene. This causes buttons behaviors that are stacked on top of each other to fire together.
Is there a way or example that shows how to properly arrange sprite nodes to allow behavior similar to UIButton, where I can have only the top button activate, and each activation disables the button for a short time afterwards?
objective-c - iOS7 Sprite Kit how to combine interactive Sprite Nodes and interactive UIViews?
I'm building a sprite kit game and have created a UIView with collection views and buttons to represent in-game inventory. From my past experience with UIView, if I add one on top of another, the top UIView would intercept touches, unless it's user interaction enabled is set to NO.
However, when I add my inventory UIView
to Scene.view
with user interaction set to YES, it appears that sprite nodes in my scene beneath the UIView still receive touches, or at least nodes that have user interaction enabled set to YES do.
As a result, it is possible for the user to interact with my inventory UIView, and still cause actions on the game board under the inventory. It appears that Kobold-Kit based button behaviors also act randomly with ones on one side of the screen being tappable through a UIView, while others are not. My other nodes that have touchesBegan: code do ignore the UIView on top of them.
I even tried to add another node on top of the existing scene, so it would capture all touches, but this does not seem to help in this case.
I would appreciate if someone explains how to properly combine UIViews with SKScene and SKSpriteNodes if I want some of my nodes to be interactive.
- Do I need a separate scene for the inventory?
- Is there a way to disable passing of touches to the scene while inventory is active?
Here's what I have so far:
UPDATE: Tested Kobold Kit's Behavior with following results:
- For Top level UI elements, like Label, collection View and UIButton, they do not pass touches through
- For regular UIViews and UIImageViews, they pass touches to the scene EVEN IF there is an interactive UIButton beneath them. Removing UIImage and exposing the same UIButton seems to stop touches from passing through.
ios - iOS Kobold Kit 如何禁用屏幕调试(gpu: renderer: ...etc)?
当一个 vanilla Sprite Kit 项目启动时,它会使用这些调用显示节点数和 FPS
但是,我似乎无法为 KKView 禁用这些,我尝试过:
我仍然在右下角看到蓝色调试文本。
如何禁用 KKView 的调试文本?
ios - Is it safe to override the SKNode's removeChild undocumented/private method?
SKNode has a removeChild undocumented method which is called on parent object when deleting its child by removeFromParent method. Is it safe to override removeChild?
swift - 使用 Swift 创建一个平铺的十六进制游戏
我是 Swift/Objective-C 的新手,但多年来一直使用 Xojo(类似于 Visual Basic)编写 Mac 和 Windows 应用程序/游戏。
我想用平铺的六角地图制作一个简单的回合制策略游戏,我想在 Mac OS X 的 Swift 中完成。什么技术最好开始?这可以通过 SpriteKit 实现吗,或者是否有任何其他我可以与 Swift 一起使用的开源磁贴引擎来让我领先一步(虽然我可以编写自己的十六进制引擎,但我宁愿不这样做,因为这不是制作一个有趣的部分游戏!)。