繁体   English   中英

SpriteKit:用于禁用点击和触摸的属性?

[英]SpriteKit: property for disabling taps and touches?

userInteractionEnabled似乎仅禁用触摸? 如果我们需要忽略轻触,该怎么办? 是否存在类似于userInteractionEnabled的属性,该属性也会导致水龙头被忽略? 这是给Swift的。

您可以使用UIApplication.sharedApplicationbeginIgnoringInteractionEvents

//Start ignoring
UIApplication.sharedApplication().beginIgnoringInteractionEvents()

要结束忽略,您可以简单地使用endIgnoringInteractionEvents

//End Ignoring
UIApplication.sharedApplication().endIgnoringInteractionEvents()

暂无
暂无

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

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