ios - How to make a border in a SKScene using a custom image -


So I surround my SKScene want to make a range of a PNG file that I have a blue border with opacity 0.8 The built edges are clear around and on the inside. Then after adding my background image I added it to my SKCIN. The border goes on top of the background as I want, but when I make a new SKPact node, its image goes to the border rather than its bottom. I tried to install the zposition of the boundary, but to show it is not the reason for any new SKSpriteNodes, even if it is clear inside the border. What I want is to be below the threshold of new SKSpriteNode, they should still give a little show because border opacity of 0.8, and still visible inside the border. Does anyone know what I'm doing wrong or how to correct it?

Thank you!

What do you say to create 4 images, namely :. Make the height and width according to the lower edge, the right edge, the top and left edge obviously

the size that you had given to the scene.

After this 4 variables are instantiated and put everything in place.

  var borderBottom = SKSpriteNode (image named: "borderbottomimage") var borderRight = SKSpriteNode (imageNamed: "borderrightimage") Var borderUp = SKSpriteNode (imageNamed: "borderupimage") var borderLieft = SKSpriteNode (imageNamed : "borderleftimage") didView in // borderBottom = CGPoint (x: CGRectGetMidX (self.frame), y: Sijiaraktgetmini (self.frame)) borderRight = CGPoint (X: CGRectGetMaxX (self.frame), Y: CGRectGetMidY (self. frame)) borderUp = CGPoint (X: CGRectGetMidX (Selfkframe), Y: CGRectGetMaxY (self.frame)) borderLeft = CGPoint (X: Sijiaraktgenetmaksaks (Selffrem), Y: Sijiaraktgetmidiwai (self Kframe)) SelfkaddChild (BorderBottom ) Self.addChild (borderRight) self.addChild (borderUp) self.addChild (borderLef T)  

set zindex and other parameters as desired. Then 'works'


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -