사진을 찍는 것은 훌륭한 경험을 기념하는 완벽한 방법입니다. 포토부스 개발자 모듈 은 플레이어가 자신의 경험을 나타내는 배경으로 독특한 포즈를 취할 수 있는 쉽게 사용할 수 있는 사진 스테이징 도구입니다.
모듈 사용
설치
경험에서 포토부스 모듈을 사용하려면:
보기 탭에서 도구 상자 를 열고 크리에이터 스토어 탭을 선택합니다.
모델 정렬이 선택되었는지 확인한 다음 모두 보기 버튼을 클릭하여 카테고리를 확인하십시오.
찾아서 클릭하십시오 개발자 모듈 타일.
사진 부스 모듈을 찾아 클릭하거나 3D 뷰에 드래그 앤 드롭하세요.
탐색기 창에서 전체 포토부스 모델을 서버스크립트 서비스 로 이동합니다.경험을 실행하면 모듈이 다양한 서비스에 배포되고 실행을 시작합니다.
부스 위치 조정
모듈은 3D 세계에 위치할 수 있는 하나의 포토부스 모델을 갖추고 있습니다.이 모델은 플레이어가 사진을 설정하기 위해 상호작용할 모델입니다.
모듈의 메인 폴더 내 포토부스 메시를 작업 공간 폴더에서 찾습니다.
최상위 수준의 작업 영역 계층으로 이동하고 원하는 위치에 배치합니다.
구성
모듈은 대부분의 사용 사례에서 작동하도록 미리 구성되었지만 configure 함수를 통해 쉽게 사용자 지정할 수 있습니다.예를 들어, 사진 하단의 기본 메시지를 변경하려면:
In 스타터 플레이어 스크립트 , 새로운 LocalScript 를 만들고 카메라 부스 구성 으로 이름을 변경합니다.
새 스크립트에 다음 코드를 붙여넣습니다.
로컬스크립트 - 포토부스 구성local ReplicatedStorage = game:GetService("ReplicatedStorage")local PhotoBooth = require(ReplicatedStorage:WaitForChild("PhotoBooth"))PhotoBooth.configure({frameMessage = "First Photo Booth Capture!",})
이벤트에 연결
사진 부스가 로컬 클라이언트에 새 화면을 표시할 때마다 해당 이벤트가 발생합니다.이 이벤트는 LocalScript에 연결하여 사용자 고유의 논리로 응답할 수 있도록 연결할 수 있습니다.
로컬 스크립트
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local PhotoBooth = require(ReplicatedStorage:WaitForChild("PhotoBooth"))
PhotoBooth.countdownStarted:Connect(function()
print("The countdown has started")
end)
PhotoBooth.printoutShown:Connect(function()
print("The printout is showing")
end)
PhotoBooth.promptShown:Connect(function()
print("The camera prompt is showing")
end)
GUI 가시성
기본적으로 사진 부스는 사진이 연출될 때 모든 ScreenGuis 및 CoreGuis를 숨깁니다.이 자동 숨기기 동작을 재정의하고 프로그래밍 방식으로 어떤 GUI가 계속 표시되어야 하는지 결정하려면 hideOtherGuis 및 showOtherGuis 호출백과 함께 자체 사용자 지정 로직으로 응답하십시오.
로컬 스크립트
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local StarterGui = game:GetService("StarterGui")
local PhotoBooth = require(ReplicatedStorage:WaitForChild("PhotoBooth"))
local player = Players.LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")
local hiddenInstances = {}
-- 숨겨지지 않는 화면 GUI 생성
local specialGuiInstance = Instance.new("ScreenGui")
-- 사진 부스 GUI 위에 화면 GUI 그리기
specialGuiInstance.DisplayOrder = 1
specialGuiInstance.Parent = playerGui
-- 화면 GUI에서 특성을 설정하여 숨기기 방지
specialGuiInstance:SetAttribute("ShowInPhotoBooth", true)
-- GUI에 텍스트 레이블 추가
local specialLabel = Instance.new("TextLabel")
specialLabel.Size = UDim2.fromScale(1, 0.1)
specialLabel.Text = "Remains visible when taking a photo"
specialLabel.Font = Enum.Font.GothamMedium
specialLabel.TextSize = 24
specialLabel.Parent = specialGuiInstance
PhotoBooth.hideOtherGuis(function()
-- 특성으로 표시된 것을 제외하고 개발자 정의 화면 GUI를 모두 숨기기
local instances = playerGui:GetChildren()
for _, instance in instances do
if instance:IsA("ScreenGui") and not instance:GetAttribute("ShowInPhotoBooth") and instance.Enabled then
instance.Enabled = false
table.insert(hiddenInstances, instance)
end
end
-- 특정 코어 GUI 숨기기
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)
end)
PhotoBooth.showOtherGuis(function()
-- 숨겨진 모든 개발자 정의 화면 GUI 표시
for _, instance in hiddenInstances do
instance.Enabled = true
end
hiddenInstances = {}
-- 숨겨진 특정 핵심 GUI 표시
StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, true)
end)
API 참조
함수
구성
구성(config: table)
기본 구성 옵션을 다음 키/값을 통해 재정의합니다 config 테이블에서.이 함수는 LocalScript 호출할 수 있습니다.
키 | 설명 | 기본 |
---|---|---|
frameMessage | 사진 하단에 표시되는 메시지. 지속 시간은 fadeUiDelay 속성을 통해 제어할 수 있습니다. | “장치를 사용하여 스크린샷을 찍고 공유하세요!” |
fadeUiDelay | 프레임 메시지가 사라지기 전에 시간을 표시하는 데 걸리는 시간(초). 음수로 설정하여 결코 사라지지 않도록 합니다. | 3 |
closeButtonImage | 닫기 사진 버튼에 사용할 이미지, closeButtonBackgroundImage 이미지 위에 배치됩니다. | “rbxassetid://7027440823” |
closeButtonBackgroundImage | 닫기 사진 버튼에 사용할 배경 이미지. | "rbxassetid://7027440891"에 |
cameraLandscapePosition | 풍경 모드로 사진을 촬영할 때 캐릭터 앞과 위로부터 사진 부스의 카메라 거리(Vector2). | (5, 2) |
cameraPortraitPosition | 초상 모드로 사진을 촬영할 때 캐릭터 앞에서 위쪽으로 카메라의 거리, Vector2). | (10, 1) |
countdownFont | 카운트다운에 사용할 폰트(Enum.Font). | GothamBlack |
countdownTextColor | 카운트다운의 숫자 색상( Color3 ). | [255, 255, 255] |
printoutCharacterPosition | 출력이 표시될 때 화면에 캐릭터의 위치(UDim2). | (0.5, 0, 0.5, 0) |
printoutCharacterSize | 문자가 출력에서 차지하는 화면 공간의 양(UDim2). | (1, 0, 1, 0) |
characterAnimation | 캐릭터가 사진에서 취하는 애니메이션의 자산 ID는 시작 프레임에서 일시 중지됩니다. | “rbxassetid://6899663224” |
filterImage | 사진에 필터로 적용할 이미지입니다. nil 경우 이미지 가장자리를 어둡게 하는 기본 필터가 사용됩니다. | nil |
로컬스크립트 - 포토부스 구성
local ReplicatedStorage = game:GetService("ReplicatedStorage")local PhotoBooth = require(ReplicatedStorage:WaitForChild("PhotoBooth"))PhotoBooth.configure({frameMessage = "What a cool pose!",fadeUiDelay = 5,maxActivationDistance = 5,printoutCharacterSize = UDim2.fromScale(1.5, 1.5),})
배경 설정
배경 설정(배경: table )
사진 부스에서 제공하는 기본 배경을 재정의합니다.배경 이미지는 최적의 경험을 위해 16:9 비율(1024×768)로 설정되어야 하며 배경 배열에 자산 ID가 포함되어야 합니다.1–4(포함) 배경이 제공될 수 있습니다.
로컬 스크립트
local ReplicatedStorage = game:GetService("ReplicatedStorage")local PhotoBooth = require(ReplicatedStorage:WaitForChild("PhotoBooth"))PhotoBooth.setBackgrounds({"rbxassetid://7018713114","rbxassetid://950538356",})
이벤트
카운트다운 시작
카운트다운이 시작되면 발생합니다. 이 이벤트는 LocalScript에만 연결할 수 있습니다.
로컬 스크립트' hightlight='5-7
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local PhotoBooth = require(ReplicatedStorage:WaitForChild("PhotoBooth"))
PhotoBooth.countdownStarted:Connect(function()
print("The countdown has started")
end)
출력 표시됨
출력이 사용자에게 표시될 때 발생합니다. 이 이벤트는 LocalScript에만 연결할 수 있습니다.
로컬 스크립트' hightlight='5-7
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local PhotoBooth = require(ReplicatedStorage:WaitForChild("PhotoBooth"))
PhotoBooth.printoutShown:Connect(function()
print("The printout is showing")
end)
프롬프트 표시
출력이 닫혀 있고 카메라 버튼이 다시 표시되면 발생합니다. 이 이벤트는 LocalScript에만 연결할 수 있습니다.
로컬 스크립트' hightlight='5-7
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local PhotoBooth = require(ReplicatedStorage:WaitForChild("PhotoBooth"))
PhotoBooth.promptShown:Connect(function()
print("The camera prompt is showing")
end)
콜백
다른 구이 숨기기
다른 기기 숨기기(콜백: function )
이 콜백은 출력이 표시되기 전에 즉시 실행되며, 출력이 표시되기 전에 전체 ScreenGuis 또는 해당 요소 전체를 비활성화할 수 있습니다.사진 부스에서 사용하는 GUI에는 특성 사진 부스에 표시 가 true 로 설정되어 있습니다.자세한 내용과 샘플 코드는 GUI 표시에 참조하십시오.
다른 구이 표시
showOtherGuis(콜백: function )
이 콜백은 출력이 닫힌 후 실행되며, 전체 ScreenGuis 또는 그 내부의 요소를 다시 활성화할 수 있습니다.사진 부스에서 사용하는 GUI에는 특성 사진 부스에 표시 가 true 로 설정되어 있습니다.자세한 내용과 샘플 코드는 GUI 표시에 참조하십시오.