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
Post a Comment