playMaker

Author Topic: Screenshot to Array (Texture)  (Read 2539 times)

SeriousRPG

  • Playmaker Newbie
  • *
  • Posts: 45
Screenshot to Array (Texture)
« on: December 15, 2015, 07:24:48 PM »
Hi,
I found the TakeCameraScreenshot in the EcoSystem and it works great but I can't figure out how to modify it to take the camera shot and store it in an array as a texture item. I don't need the physical screenshot stored on disk, infact it would be preferable if it didn't save it at all.

I have a GUI panel that shows all the "pictures" that the user captured, if they press a button, so I prefer to increment the array with textures and display if requested.

Is this something doable? (I assume I can use an array since I am not trying to get one item vs. another, just circle through them all and display them in a table in a UI panel.)

Sandi

phannDOTde

  • Full Member
  • ***
  • Posts: 237
    • Peter Hann .de
Re: Screenshot to Array (Texture)
« Reply #1 on: January 02, 2016, 11:02:03 AM »
You might want to see the topic "render textures" in the unity documentation or google it.

What you (assumable) want to do is so render your scene into a texture and use that texture on an object, that fore you will need to
1.) render into a texture from a camera
2.) take a snapshot from the rendertexture to be used as your UI texture thing

dudebxl

  • Hero Member
  • *****
  • Posts: 602
Re: Screenshot to Array (Texture)
« Reply #2 on: January 02, 2016, 01:56:32 PM »
.. and the screenshot action saves the picture to the PC/Device so see this post http://hutonggames.com/playmakerforum/index.php?topic=10978.0  and maybe it will help you.

All you need to do actually is get the picture from wherever you saved it and load into an array.
« Last Edit: January 02, 2016, 02:11:08 PM by dudebxl »

SeriousRPG

  • Playmaker Newbie
  • *
  • Posts: 45
Re: Screenshot to Array (Texture)
« Reply #3 on: January 08, 2016, 05:46:57 PM »
Thanks for the reply.

My client has a requirement that the photo is never stored to disk so I need to capture it internally in the game and render it back but if they exit the game the photo is never stored anywhere. I also need to be able to capture a "movie" and do the same but I figured one thing at a time...

Sandi

dudebxl

  • Hero Member
  • *****
  • Posts: 602
Re: Screenshot to Array (Texture)
« Reply #4 on: January 08, 2016, 11:26:51 PM »
Then you have to do like phanndotde says..

Or modify the action to not save it to the device but add the texture to a fsmtexture and load that texture then to an array using the array add action.


When i have a minute, i will add this option as it would useful. Try something like this:
Delete 33 to 41. + whatever is red in reset section
Add Line 57 Public FsmTexture2D test;
Delete line 133 to 161
Add Line 131  test.Value = screenShot;

Not tested (on ipad) so let me know it it works..