0

I'm trying to take a screen shot of my current SKScene and apply filters to it as a background element when a message box pops in my game. I think this is the most efficient way to do this...

  1. Take screen shot of the current app state
  2. Pass this to my message box class
  3. Run blur filters, darken it
  4. Add it (as a texture or image) behind my my message box layer and over the current contents of the app
  5. draw the message on top of it

I know there is a UIView method - drawViewHierarchyInRect:afterScreenUpdates: that will capture the contents of the UIView with my SKScene in it - but how would I convert the resulting UIImage into something I can use in SpriteKit? I really don't need the whole UIView, just my current SKScene.

Appreciate any tips or feedback about what I'm doing. Thanks!

Zach Langley
  • 6,776
  • 1
  • 26
  • 25
  • have you considered using SKEffectNode to blur the scene for you? – CodeSmile Dec 13 '13 at 18:34
  • No ... I don't know how to get the UIView added as a child to my SKSpriteNode... – Matt Perkins Dec 13 '13 at 18:47
  • you can't add a uiview to a node, only another view (the skview). But it sounds like your effect can be done entirely with effect node to create a fullscreen blur, then overlay a transparent msg box by adding it to skview. – CodeSmile Dec 13 '13 at 23:26
  • Agree - but this post says the performance is poor - but I'll give it a go on Monday http://stackoverflow.com/questions/18937461/how-to-apply-full-screen-skeffectnode-for-post-processing-in-spritekit – Matt Perkins Dec 14 '13 at 15:05
  • how would you apply the blur effect? With a CIFilter, same as effect node uses. It won't be superfast either way. – CodeSmile Dec 14 '13 at 21:42
  • I'm not sure! :) I'm still learning ... haven't gotten that far yet – Matt Perkins Dec 15 '13 at 14:14

0 Answers0