배우기
엔진 클래스
CaptureService
만들 수 없음
서비스

*이 콘텐츠는 AI(베타)를 사용해 번역되었으며, 오류가 있을 수 있습니다. 이 페이지를 영어로 보려면 여기를 클릭하세요.


요약
메서드
CaptureScreenshot(onCaptureReady: function):()
PromptSaveCapturesToGallery(captures: {any},resultCallback: function):()
PromptShareCapture(captureContent: Content,launchData: string,onAcceptedCallback: function,onDeniedCallback: function):()
ReadCapturesFromGalleryAsync(captureTypeFilters: {any},readFromAllEligibleExperiences: boolean):Tuple
TakeScreenshotCaptureAsync(onCaptureReady: function,captureParams: Dictionary):()
이벤트
CaptureSaved(captureInfo: Dictionary):RBXScriptSignal
사용되지 않음
UserCaptureSaved(captureContentId: ContentId):RBXScriptSignal
상속된 멤버

API 참조
메서드
CaptureScreenshot
기능: Capture
CaptureService:CaptureScreenshot(onCaptureReady:function):()
매개 변수
onCaptureReady:function
반환
()
코드 샘플
스크린샷 캡처
local CaptureService = game:GetService("CaptureService")
-- 이 코드를 포함하는 스크립트의 ImageLabel 부모에 대한 참조
local imageLabel = script.Parent
local function onCaptureReady(contentId)
imageLabel.Image = contentId
end
CaptureService:CaptureScreenshot(onCaptureReady)

CheckUploadCaptureStatusAsync
생성
기능: Capture
CaptureService:CheckUploadCaptureStatusAsync(token:string):Tuple
매개 변수
token:string
반환

PromptCaptureGalleryPermissionAsync
생성
기능: Capture
CaptureService:PromptCaptureGalleryPermissionAsync(captureGalleryPermission:Enum.CaptureGalleryPermission):boolean
매개 변수
captureGalleryPermission:Enum.CaptureGalleryPermission
반환
코드 샘플
캡처 갤러리 권한 요청
local CaptureService = game:GetService("CaptureService")
local function isGalleryAccessGranted()
local accepted = CaptureService:PromptCaptureGalleryPermissionAsync(Enum.CaptureGalleryPermission.ReadAndUpload)
return accepted
end

PromptSaveCapturesToGallery
기능: Capture
CaptureService:PromptSaveCapturesToGallery(
captures:{any}, resultCallback:function
):()
매개 변수
captures:{any}
resultCallback:function
반환
()

PromptShareCapture
기능: Capture
CaptureService:PromptShareCapture(
captureContent:Content, launchData:string, onAcceptedCallback:function, onDeniedCallback:function
):()
매개 변수
captureContent:Content
launchData:string
onAcceptedCallback:function
onDeniedCallback:function
반환
()
코드 샘플
프롬프트 공유 캡처
local CaptureService = game:GetService("CaptureService")
local function onShareAccepted()
print("공유 캡처가 수락되었습니다!")
end
local function onShareDenied()
print("공유 캡처가 거부되었습니다!")
end
local onCaptureReady = function(result, videoCapture)
if videoCapture then
local captureContent = Content.fromObject(videoCapture)
CaptureService:PromptShareCapture(captureContent, "launchData" , onShareAccepted, onShareDenied)
end
end
CaptureService:StartVideoCaptureAsync(onCaptureReady, {})

ReadCapturesFromGalleryAsync
생성
기능: Capture
CaptureService:ReadCapturesFromGalleryAsync(
captureTypeFilters:{any}, readFromAllEligibleExperiences:boolean
매개 변수
captureTypeFilters:{any}
기본값: "{}"
readFromAllEligibleExperiences:boolean
기본값: false
반환
코드 샘플
갤러리에서 캡처를 읽고 페이지를 반복합니다
local CaptureService = game:GetService("CaptureService")
local function readCapturesFromGallery()
local allCaptures = {}
local capturesPages
local success, result = pcall(function()
local readResult, pages = CaptureService:ReadCapturesFromGalleryAsync({}, false)
if readResult == Enum.ReadCapturesFromGalleryResult.Success then
capturesPages = pages
end
return readResult
end)
if not success or result ~= Enum.ReadCapturesFromGalleryResult.Success then
-- 권한 오류일 가능성이 높습니다. CaptureService:PromptCaptureGalleryPermissionAsync()를 참조하세요.
warn("초기 캡처를 가져오는 데 실패했습니다: " .. result.Name)
return
end
-- 현재 페이지를 반복합니다
local currentPage = capturesPages:GetCurrentPage()
for _, capture in currentPage do
table.insert(allCaptures, capture)
end
-- 완료될 때까지 다음 페이지로 진행합니다
while not capturesPages.IsFinished do
local advanceToNextPageSuccess, _ = pcall(function()
capturesPages:AdvanceToNextPageAsync()
end)
if not advanceToNextPageSuccess then
return
end
currentPage = capturesPages:GetCurrentPage()
for _, capture in currentPage do
table.insert(allCaptures, capture)
end
end
return allCaptures
end

StartUploadCaptureAsync
생성
기능: Capture
CaptureService:StartUploadCaptureAsync(capture:Capture):Tuple
매개 변수
capture:Capture
반환

StartVideoCaptureAsync
생성
기능: Capture
CaptureService:StartVideoCaptureAsync(
onCaptureReady:function, captureParams:Dictionary
매개 변수
onCaptureReady:function
captureParams:Dictionary
기본값: "nil"
코드 샘플
비디오 캡처 비동기 시작
local CaptureService = game:GetService("CaptureService")
local tool = Instance.new("Tool")
tool.Parent = workspace
local onCaptureReady = function(result, videoCapture)
if result ~= Enum.VideoCaptureResult.Success and result ~= Enum.VideoCaptureResult.TimeLimitReached or not videoCapture then
print("비디오 녹화가 다음 이유로 완료되지 않았습니다:", result)
else
-- 사용자에게 비디오 캡처를 갤러리에 저장하라는 메시지를 표시합니다.
CaptureService:PromptSaveCapturesToGallery({ videoCapture }, function()
print("캡처가 저장되었습니다")
end)
end
end
tool.Activated:Connect(function()
local videoRecordingAllowedResult: Enum.VideoCaptureStartedResult = CaptureService:StartVideoCaptureAsync(onCaptureReady, {})
if videoRecordingAllowedResult ~= Enum.VideoCaptureStartedResult.Success then
print("비디오 녹화가 다음 이유로 시작되지 않았습니다:", videoRecordingAllowedResult)
end
end)

StopVideoCapture
기능: Capture
CaptureService:StopVideoCapture():()
반환
()

TakeScreenshotCaptureAsync
기능: Capture
CaptureService:TakeScreenshotCaptureAsync(
onCaptureReady:function, captureParams:Dictionary
):()
매개 변수
onCaptureReady:function
captureParams:Dictionary
기본값: "nil"
반환
()
코드 샘플
스크린샷 캡처 비동기
local CaptureService = game:GetService("CaptureService")
local parent = Instance.new("Tool")
parent.Parent = workspace
local onCaptureReady = function(result, screenshotCapture)
if result ~= Enum.ScreenshotCaptureResult.Success or not screenshotCapture then
print("스크린샷이 다음 이유로 완료되지 않았습니다:", result)
else
-- 사용자에게 스크린샷 캡처를 갤러리에 저장하라는 메시지를 표시합니다.
CaptureService:PromptSaveCapturesToGallery({ screenshotCapture }, function(results)
for capture, result in pairs(results) do
if result then
print("캡처가 저장되었습니다")
end
end
end)
end
end
parent.Activated:Connect(function()
CaptureService:TakeScreenshotCaptureAsync(onCaptureReady, { UICaptureMode = Enum.UICaptureMode.All })
end)

UploadCaptureAsync
생성
기능: Capture
CaptureService:UploadCaptureAsync(capture:Capture):Tuple
매개 변수
capture:Capture
반환
코드 샘플
자산 시스템에 캡처 업로드
local CaptureService = game:GetService("CaptureService")
local function uploadCapture(capture: Capture)
local success, result = pcall(function()
local uploadCaptureResult, assetId = CaptureService:UploadCaptureAsync(capture)
if uploadCaptureResult ~= Enum.UploadCaptureResult.Success then
-- 실패 처리
return nil
end
return assetId
end)
if not success then
-- 오류 처리
return nil
end
return result
end

이벤트
CaptureBegan
기능: Capture
CaptureService.CaptureBegan(captureType:Enum.CaptureType):RBXScriptSignal
매개 변수
captureType:Enum.CaptureType

CaptureEnded
기능: Capture
CaptureService.CaptureEnded(captureType:Enum.CaptureType):RBXScriptSignal
매개 변수
captureType:Enum.CaptureType

CaptureSaved
사용되지 않음

UserCaptureSaved
기능: Capture
CaptureService.UserCaptureSaved(captureContentId:ContentId):RBXScriptSignal
매개 변수
captureContentId:ContentId

©2026 Roblox Corporation. Roblox 및 Roblox 로고, 'Powering Imagination'은 미국 및 기타 국가 내 당사의 등록 및 미등록 상표입니다.