Roblox는 사용자가 경험에 연결할 때 기본 로딩 화면을 표시하지만, 정적 또는 애니메이션 콘텐츠가 포함된 사용자 지정 로딩 화면으로 경험을 개인화할 수 있습니다.
사용자 지정 로딩 화면 표시
사용자 지정 로딩 화면을 표시하려면 직접 에서 인스턴스를 디자인하거나 작업 공간에서 개체를 참조할 수 있습니다.둘 다 ReplicatedFirst 을 사용하여 다른 것보다 먼저 인스턴스를 클라이언트에 복제하는 서비스를 복제합니다.이렇게 하면 사용자가 경험에 들어갈 때 처음 보는 로딩 화면이 됩니다.
LocalScripts 내에서 디자인
사용자 지정 로딩 화면을 디자인하고 표시하려면:
- In ReplicatedFirst 에서 LocalScript하십시오.
- 다음 코드 샘플을 사용하여 ScreenGui 개체를 만들고 사용자 지정합니다.디자인을 만들기 위해 자신의 값으로 다음 코드를 수정할 수 있습니다:
local Players = game:GetService("Players")local ReplicatedFirst = game:GetService("ReplicatedFirst")local player = Players.LocalPlayerlocal playerGui = player:WaitForChild("PlayerGui")local screenGui = Instance.new("ScreenGui")screenGui.IgnoreGuiInset = truescreenGui.Parent = playerGui-- ScreenGui 값을 보유값으로 대체local textLabel = Instance.new("TextLabel")textLabel.Size = UDim2.new(1, 0, 1, 0)textLabel.BackgroundColor3 = Color3.fromRGB(0, 20, 40)textLabel.Font = Enum.Font.GothamMediumtextLabel.TextColor3 = Color3.new(0.8, 0.8, 0.8)textLabel.Text = "Loading"textLabel.TextSize = 28textLabel.Parent = screenGui-- 기본 로딩 화면 제거ReplicatedFirst:RemoveDefaultLoadingScreen()task.wait(5) -- 최소 시간 동안 화면 표시 강제 Force screen to appear for a minimum number of secondsif not game:IsLoaded() thengame.Loaded:Wait()endscreenGui:Destroy()
참조 화면 가이드
대신 를 통해 생성하는 대신, 작업 공간에서 직접 기존의 를 참조할 수도 있습니다.경험에 ScreenGui 내에 포함되고 ReplicatedFirst 내에 UI 요소가 포함된 ScreenGui 및 TextLabels 및 ImageLabels 와 같은 요소가 포함된 LocalScript 가 포함되어 있는지 확인한 다음 해당 내용을 참조하여 로딩 화면으로 설정합니다.이 메서드를 사용하면 생성하는 동안 로딩 화면을 쉽게 볼 수 있습니다.
이 프로세스를 보여주기 위해, 다음 LocalScript 참조는 ScreenGui 명명된 로딩 화면 내에서 ReplicatedFirst 를 제거하여 사용자가 볼 수 있는 유일한 로딩 화면은 사용자 자신의 사용자 지정 로딩 화면입니다:
local Players = game:GetService("Players")local ReplicatedFirst = game:GetService("ReplicatedFirst")local player = Players.LocalPlayerlocal playerGui = player:WaitForChild("PlayerGui")local screenGui = ReplicatedFirst.LoadingScreenscreenGui.IgnoreGuiInset = truescreenGui.Parent = playerGui-- 기본 로딩 화면 제거ReplicatedFirst:RemoveDefaultLoadingScreen()task.wait(5) -- 최소 시간 동안 화면 표시 강제 Force screen to appear for a minimum number of secondsif not game:IsLoaded() thengame.Loaded:Wait()endscreenGui:Destroy()
애니메이션 추가
정적 사용자 지정 로딩 화면 외에도 로딩 화면을 향상시키고 로딩 진행률을 나타내기 위해 애니메이션을 추가할 수 있습니다.가장 쉬운 방법은 UI 요소(예: TextLabel 또는 ImageLabel)를 만들고, TweenService를 사용하여 애니메이션을 구현하는 것입니다.예를 들어 다음 코드 샘플은 자식 ScreenGui 을 사용하여 새로운 ImageLabel 를 생성하고, 기본 로딩 화면을 제거한 다음 TweenService 경험이 로드될 때까지 계속해서 ImageLabel 를 회전합니다.
local Players = game:GetService("Players")local ReplicatedFirst = game:GetService("ReplicatedFirst")local TweenService = game:GetService("TweenService")local player = Players.LocalPlayerlocal playerGui = player:WaitForChild("PlayerGui")local screenGui = Instance.new("ScreenGui")screenGui.IgnoreGuiInset = truescreenGui.Parent = playerGuilocal textLabel = Instance.new("TextLabel")textLabel.Size = UDim2.new(1, 0, 1, 0)textLabel.BackgroundColor3 = Color3.fromRGB(0, 20, 40)textLabel.Font = Enum.Font.GothamMediumtextLabel.TextColor3 = Color3.new(0.8, 0.8, 0.8)textLabel.Text = "Loading"textLabel.TextSize = 28textLabel.Parent = screenGuilocal loadingRing = Instance.new("ImageLabel")loadingRing.Size = UDim2.new(0, 256, 0, 256)loadingRing.BackgroundTransparency = 1loadingRing.Image = "rbxassetid://4965945816"loadingRing.AnchorPoint = Vector2.new(0.5, 0.5)loadingRing.Position = UDim2.new(0.5, 0, 0.5, 0)loadingRing.Parent = screenGui-- 기본 로딩 화면 제거ReplicatedFirst:RemoveDefaultLoadingScreen()local tweenInfo = TweenInfo.new(4, Enum.EasingStyle.Linear, Enum.EasingDirection.In, -1)local tween = TweenService:Create(loadingRing, tweenInfo, {Rotation = 360})tween:Play()task.wait(5) -- 최소 시간 동안 화면 표시 강제 Force screen to appear for a minimum number of secondsif not game:IsLoaded() thengame.Loaded:Wait()endscreenGui:Destroy()