API for taking screenshots ingame

In my new game, I have a photo booth mode where people can manipulate a camera to get the best shot of an automobile. I would like people to be able to take photos of the automobile without GUIs getting in the way. For that, I would like some kind of API that can force Roblox to take a photo.

Here is an example of a pose that is possible in my game:

Although this screenshot is taken on a computer, the game is intended for a primarily mobile audience. An audience that has a much larger top bar in relation to screen size. Because of this, I would like this screenshot function to have the ability to take the screenshot underneath the CoreGUI and game GUI, so that mobile players can have the precious 32 pixels they would otherwise be denied.

Even if the ability to take a screenshot without the CoreGUI and game GUI in the way is not implemented, having a screenshot API allows me to create a much better user experience, as with such a method I can have a button that disables the GUI momentarily while the screenshot is being taken, then play an appropriate camera animation.

EDIT: this feature would also make it a simple task to make a stop-motion animation suite inside Roblox.

Possible API members:

method TakeScreenshot(bool WithoutGui)

event ScreenshotTaken(bool WithoutGui)

EDIT: inspired by jwood’s edit:

event ScreenshotUploaded(content assetURL)
34 Likes

I’m all for it.

Are you aware that you can hide those 36 pixels btw?

1 Like

Would love this - it would be a great feature!

There would just need to be something to prevent spamming it and filling up a users hard drive :stuck_out_tongue:

EDIT: What would be cool as well, is the abililty to use that screenshot in-game (possibly after being moderated?) - For example, a photo booth - users could pose for a picture and then have their picture “printed out” onto a part in-game!

1 Like

I know I can turn the top bar invisible once I remove all the removable icons, but a few icons are still there.

@jjwood1600 there’s no way a dev could do that unnoticed. Screenshots freeze the game for 0.5 - 2 seconds.

1 Like

@NWSpacek - True! Although if ROBLOX ever fixed that and introduced this, that would need to be prevented!

1 Like

I edited the OP with an API member relating to your edit. It will be up to the developer to warn players that screenshots will not immediately show up for others because they have to be moderated first.

2 Likes

As a Roblox developer, it is currently not possible to take a screenshot in-game from within scripts. Roblox already has a built-in screenshot tool, but it can only be utilized through the pause menu.

What I am proposing is that a new function is added to player objects that would show a popup window, similar to the window that appears when a player wants to make a purchase, that would ask if the player wants to take a screenshot. It would be a function of “Player” objects, and could have properties to hide the CoreGui in screenshots, hide ScreenGuis in the screenshot, and a callback function that would fire when the player either rejects or accepts the screenshot request. The callback would be useful for scripts detecting when the player took a screenshot and running extra code. The reason it would ask in a popup window is so that games couldn’t store files on player’s devices without their consent (the Roblox screenshot tool saves to the device, not online).

If Roblox is able to address this issue, it would improve my development experience because it would offer a way for developers to easily create ways for players to take pictures of their avatars, game maps, etc.

Use Cases:

  • My use case is to make a “camera” tool that players could use to take pictures. With the new Depth of Field post-processing effect (Release Notes for 427) that is coming soon, I wanted to create a camera that could “focus” wherever a player clicks/taps.
  • A camera that would let players add effects or “filters”, like on social media, to their avatars.
  • I’m sure there are many other use cases, but these are just a few.
5 Likes

As a Roblox Developer I currently cannot prompt users to take a screenshot. This is hampering my ability to do two things.

  • Encourage people to use emotes to pose and take pictures
  • Encourage people to take and share pictures of Roblox

Motivation: Adding a mechanic to take selfies with the NPCs / other players to increase friendship! It’s impossible to do this right now!

Given that Roblox already has a screenshot system built in, I was thinking that perhaps there could be an API for developers to take screenshots in the engine through the camera. This would work like the friendship system does, where it prompts the user to save the screenshot.

7 Likes

To those who don’t know, this is now possible:

1 Like