sprite kit - swift/spritekit: Is there a way to add a SKLabelNode to an SKView? -


i'm trying create hud sits @ top of screen , doesn't move rest of scene. able static view there this:

class gamescene: skscene, skphysicscontactdelegate {     override func didmovetoview(view: skview) {         /* setup scene here */          let hud = skview()         hud.alpha = 0.5         hud.backgroundcolor = skcolor.greencolor()         hud.frame = cgrect(x: 0.5, y: 0.5, width: view.bounds.width, height: 50)         self.view?.addsubview(hud) 

so that, player can walk around scene, camera follows him, there transparent view across top think want.

so next tried adding things hud view @ top can't seem figure out. example, if create sklabel node can't add hud.addchild because skview doesn't have addchild. tried doing hud.addsubview sklabel isn't uiview, addsubview expects.

does know how add things hud labels?


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -