Reference API Roblox

Engine API

Website

Related

Reference API Roblox

CaptureService

A service which provides control over screenshot capture features.

This class is not creatable. Instances of this class cannot be created with Instance.new.
This class is a service. It is a singleton that may be acquired with GetService.
Tags: [NotCreatable, Service]

Member index 28

HistoryMember
608CaptureScreenshot(onCaptureReady: Function): null
632CreatePostAsync(pathArr: Array, caption: string): Dictionary
593DeleteCapture(capturePath: string): null
620DeleteCapturesAsync(pathArr: Array): int64
645GetCaptureFilePathAsync(captureContentId: ContentId): string
645GetCaptureSizeAsync(captureContentId: ContentId): Vector2
617GetCaptureStorageSizeAsync(pathArr: Array): int64
641GetCaptureUploadDataAsync(capturePath: string): Dictionary
605OnCaptureBegan(): null
605OnCaptureEnded(): null
625OnCaptureShared(capturePath: string): null
605OnSavePromptFinished(promptId: int64, results: Dictionary): null
604OnSharePromptFinished(promptId: int64, accepted: bool): null
605PromptSaveCapturesToGallery(contentIds: Array, resultCallback: Function): null
645PromptShareCapture(contentId: ContentId, launchData: string, onAcceptedCallback: Function, onDeniedCallback: Function): null
583RetrieveCaptures(): Array
601SaveCaptureToExternalStorage(capturePath: string): null
625SaveCapturesToExternalStorageAsync(pathArr: Array): int64
645SaveScreenshotCapture(additionalInfo: string = ): null
605CaptureBegan()
605CaptureEnded()
632CaptureSaved(captureInfo: Dictionary)
626CaptureSavedInternal(captureInfo: Dictionary, triggerSource: string)
605OpenSaveCapturesPrompt(promptId: int64, contentIds: Array)
645OpenShareCapturePrompt(promptId: int64, contentId: ContentId, launchData: string)
645UserCaptureSaved(captureContentId: ContentId)
inherited from Instance
553Archivable: bool
635Capabilities: SecurityCapabilities
553Name: string
553Parent: Instance
635Sandboxed: bool
616UniqueId: UniqueId
576AddTag(tag: string): null
573ClearAllChildren(): null
462Clone(): Instance
573Destroy(): null
486FindFirstAncestor(name: string): Instance
486FindFirstAncestorOfClass(className: string): Instance
486FindFirstAncestorWhichIsA(className: string): Instance
486FindFirstChild(name: string, recursive: bool = false): Instance
486FindFirstChildOfClass(className: string): Instance
486FindFirstChildWhichIsA(className: string, recursive: bool = false): Instance
486FindFirstDescendant(name: string): Instance
563GetActor(): Actor
486GetAttribute(attribute: string): Variant
462GetAttributeChangedSignal(attribute: string): RBXScriptSignal
631GetAttributes(): Dictionary
648GetChildren(): Instances
462GetDebugId(scopeLength: int = 4): string
486GetDescendants(): Array
486GetFullName(): string
641GetStyled(name: string): Variant
576GetTags(): Array
576HasTag(tag: string): bool
486IsAncestorOf(descendant: Instance): bool
486IsDescendantOf(ancestor: Instance): bool
580IsPropertyModified(name: string): bool
573Remove(): null
576RemoveTag(tag: string): null
580ResetPropertyToDefault(name: string): null
573SetAttribute(attribute: string, value: Variant): null
462WaitForChild(childName: string, timeOut: double): Instance
648children(): Instances
553clone(): Instance
573destroy(): null
553findFirstChild(name: string, recursive: bool = false): Instance
648getChildren(): Instances
553isDescendantOf(ancestor: Instance): bool
573remove(): null
462AncestryChanged(child: Instance, parent: Instance)
462AttributeChanged(attribute: string)
462ChildAdded(child: Instance)
462ChildRemoved(child: Instance)
462DescendantAdded(descendant: Instance)
462DescendantRemoving(descendant: Instance)
500Destroying()
553childAdded(child: Instance)
inherited from Object
647ClassName: string
647className: string
647GetPropertyChangedSignal(property: string): RBXScriptSignal
647IsA(className: string): bool
650isA(className: string): bool
647Changed(property: string)

Removed member index 2

HistoryMember
651PostToFeedAsync(capturePath: string, feedCategory: string): Dictionary
583RetreiveCaptures(): Array

Description

CaptureService is a client-side service that allows developers to control how the screenshot capture feature integrates with their experiences. It can be used to include preset moments where a screenshot is automatically taken for a user, and that user can then save, share, or delete the screenshot.

History 55

Members 28

CaptureBegan

Parameters (0)
No parameters.

This event fires right before a new screenshot capture is taken. It can be used to customize the capture experience, for example by hiding certain GUI elements.

History 1

CaptureEnded

Parameters (0)
No parameters.

This event fires after a new screenshot capture completes. It can be used to restore any changes made when the CaptureBegan event fired.

History 1

CaptureSaved

Parameters (1)
captureInfoDictionary
This event is deprecated. It exists only for backward compatibility, and should not be used for new work. UserCaptureSaved should be used instead.

History 4

Tags: [Deprecated]

CaptureSavedInternal

Parameters (2)
captureInfoDictionary
triggerSourcestring

History 2

CaptureScreenshot

Parameters (1)
onCaptureReadyFunction
Returns (1)
null

This method captures a screenshot for the user but does not immediately save it to their Captures gallery within the experience's main menu. Instead, a temporary contentId is created to identify the new capture.

The onCaptureReady callback can be used to prompt the user to save or share the screenshot:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
local CaptureService = game:GetService("CaptureService")

-- Reference to an ImageLabel parent of the script containing this code
local imageLabel = script.Parent

local function onCaptureReady(contentId)
	imageLabel.Image = contentId
end

CaptureService:CaptureScreenshot(onCaptureReady)

History 1

CreatePostAsync

Parameters (2)
pathArrArray
captionstring
Returns (1)
Dictionary
This function yields. It will block the calling thread until completion.

History 1

Tags: [Yields]

DeleteCapture

Parameters (1)
capturePathstring
Returns (1)
null

History 1

DeleteCapturesAsync

Parameters (1)
pathArrArray
Returns (1)
int64
This function yields. It will block the calling thread until completion.

History 1

Tags: [Yields]

GetCaptureFilePathAsync

Parameters (1)
captureContentIdContentId
Returns (1)
string
This function yields. It will block the calling thread until completion.

History 2

Tags: [Yields]

GetCaptureSizeAsync

Parameters (1)
captureContentIdContentId
Returns (1)
Vector2
This function yields. It will block the calling thread until completion.

History 2

Tags: [Yields]

GetCaptureStorageSizeAsync

Parameters (1)
pathArrArray
Returns (1)
int64
This function yields. It will block the calling thread until completion.

History 1

Tags: [Yields]

GetCaptureUploadDataAsync

Parameters (1)
capturePathstring
Returns (1)
Dictionary
This function yields. It will block the calling thread until completion.

History 1

Tags: [Yields]

OnCaptureBegan

Parameters (0)
No parameters.
Returns (1)
null

History 1

OnCaptureEnded

Parameters (0)
No parameters.
Returns (1)
null

History 1

OnCaptureShared

Parameters (1)
capturePathstring
Returns (1)
null

History 1

OnSavePromptFinished

Parameters (2)
promptIdint64
resultsDictionary
Returns (1)
null

History 1

OnSharePromptFinished

Parameters (2)
promptIdint64
acceptedbool
Returns (1)
null

History 3

OpenSaveCapturesPrompt

Parameters (2)
promptIdint64
contentIdsArray

History 1

OpenShareCapturePrompt

Parameters (3)
promptIdint64
contentIdContentId
launchDatastring

History 6

PromptSaveCapturesToGallery

Parameters (2)
contentIdsArray
resultCallbackFunction
Returns (1)
null

This method prompts the user to save the screenshots identified by the provided contentIds to their Captures gallery within the experience's main menu.

History 1

PromptShareCapture

Parameters (4)
contentIdContentId
launchDatastring
onAcceptedCallbackFunction
onDeniedCallbackFunction
Returns (1)
null

This method prompts the user to share the screenshot identified by the provided contentId using the native share sheet on their device.

The capture image will be shared along with an invite link to the experience when supported. Not all devices/apps support including both a screenshot and invite link.

The launchData will be available in the launchData field for users who join through the invite link.

History 5

RetrieveCaptures

Parameters (0)
No parameters.
Returns (1)
Array

History 1

SaveCaptureToExternalStorage

Parameters (1)
capturePathstring
Returns (1)
null

History 1

SaveCapturesToExternalStorageAsync

Parameters (1)
pathArrArray
Returns (1)
int64
This function yields. It will block the calling thread until completion.

History 1

Tags: [Yields]

SaveScreenshotCapture

Parameters (1)Default
additionalInfostring
Returns (1)
null

History 2

UserCaptureSaved

Parameters (1)
captureContentIdContentId

This event fires when the user saves a screenshot using the Roblox screenshot capture UI. It can be used for analytics or to prompt the user to share their capture.

History 4

Removed members 2

PostToFeedAsync

Parameters (2)
capturePathstring
feedCategorystring
Returns (1)
Dictionary
This function yields. It will block the calling thread until completion.

History 2

Tags: [Yields]

RetreiveCaptures

Parameters (0)
No parameters.
Returns (1)
Array

History 2

Settings