Empty
Empty
Empty
ScreenGuiは、Robloxでプレイヤーの画面に表示される2Dユーザーインターフェース要素のコンテナです。基本的なコントロールや情報を提供します。
** PlayerGuiに親付けされる必要があります。StarterGuiを使用すると、プレイヤーが参加したときにそれが各プレイヤーのPlayerGuiにクローンされます。
local screenGui = Instance.new("ScreenGui")
screenGui.Parent = game.Players.LocalPlayer: WaitForChild("PlayerGui")
ScreenGuiのプロパティ
Types | Details |
---|---|
ClipToDeviceSafeArea | コンテンツをデバイスの安全エリアにクリップします。 |
DisplayOrder | ScreenGuiのZインデックス順序を制御し、値が大きいほど上に表示されます。 |
IgnoreGuiInset | ScreenGuiがRobloxのコアUI要素にオーバーフローするかどうかを決定します。 |
ScreenInsets | 画面上の表示領域を定義します。 |
CoreUISafeInsets
CoreUISafeInsets | UI要素をコアUI安全領域内に保持し、トップバーのボタンや画面の切り欠きを避けます(デフォルト)。 |
None | 安全領域の制約なし; UI要素がコアUIまたはデバイスの切り欠きによって隠れる可能性があります。非インタラクティブなコンテンツに適しています。 |
TopbarSafeInsets | UI要素が最も左側のRobloxコントロールとデバイスの安全領域の間に保持されるようにし、衝突を避けるために動的に調整します。 |
DeviceSafeInsets | デバイスの安全領域全体にインセットを適用し、画面の切り欠きやノッチを避けます。 |
Empty
Empty
Empty
Roblox Studio
local screenGui = Instance.new("ScreenGui")
screenGui.Name = "Display_CoreUISafeInsets"
screenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
screenGui.ScreenInsets = Enum.ScreenInsets.CoreUISafeInsets
local frame = Instance.new("Frame")
frame.Size = UDim2.new(1, 0, 1, 0)
frame.Position = UDim2.new(0, 0, 0, 0)
frame.BackgroundTransparency = 0.5
frame.BackgroundColor3 = Color3.fromRGB(255, 0, 0) -- Red for CoreUISafeInsets
frame.Parent = screenGui
local label = Instance.new("TextLabel")
label.Text = "CoreUISafeInsets"
label.BackgroundTransparency = 0
label.BackgroundColor3 = Color3.fromRGB(255, 255, 255) -- White background
label.TextColor3 = Color3.fromRGB(0, 0, 0) -- Black text
label.Size = UDim2.new(0.3, 0, 0.1, 0)
label.Position = UDim2.new(0.35, 0, 0.45, 0)
label.Parent = frame
Empty
Empty
Empty
Roblox Studio
local screenGui = Instance.new("ScreenGui")
screenGui.Name = "Display_None"
screenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
screenGui.ScreenInsets = Enum.ScreenInsets.None
local frame = Instance.new("Frame")
frame.Size = UDim2.new(1, 0, 1, 0)
frame.Position = UDim2.new(0, 0, 0, 0)
frame.BackgroundTransparency = 0.5
frame.BackgroundColor3 = Color3.fromRGB(0, 255, 0) -- Green for None
frame.Parent = screenGui
local label = Instance.new("TextLabel")
label.Text = "None"
label.BackgroundTransparency = 0
label.BackgroundColor3 = Color3.fromRGB(255, 255, 255) -- White background
label.TextColor3 = Color3.fromRGB(0, 0, 0) -- Black text
label.Size = UDim2.new(0.3, 0, 0.1, 0)
label.Position = UDim2.new(0.35, 0, 0.45, 0)
label.Parent = frame
Empty
Empty
Empty
Roblox Studio
local screenGui = Instance.new("ScreenGui")
screenGui.Name = "Display_TopbarSafeInsets"
screenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
screenGui.ScreenInsets = Enum.ScreenInsets.TopbarSafeInsets
local frame = Instance.new("Frame")
frame.Size = UDim2.new(1, 0, 1, 0)
frame.Position = UDim2.new(0, 0, 0, 0)
frame.BackgroundTransparency = 0.5
frame.BackgroundColor3 = Color3.fromRGB(0, 0, 255) -- Blue for TopbarSafeInsets
frame.Parent = screenGui
local label = Instance.new("TextLabel")
label.Text = "TopbarSafeInsets"
label.BackgroundTransparency = 0
label.BackgroundColor3 = Color3.fromRGB(255, 255, 255) -- White background
label.TextColor3 = Color3.fromRGB(0, 0, 0) -- Black text
label.Size = UDim2.new(0.3, 0, 0.1, 0)
label.Position = UDim2.new(0.35, 0, 0.45, 0)
label.Parent = frame
Empty
Empty
Empty
Roblox Studio
local screenGui = Instance.new("ScreenGui")
screenGui.Name = "Display_DeviceSafeInsets"
screenGui.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui")
screenGui.ScreenInsets = Enum.ScreenInsets.DeviceSafeInsets
local frame = Instance.new("Frame")
frame.Size = UDim2.new(1, 0, 1, 0)
frame.Position = UDim2.new(0, 0, 0, 0)
frame.BackgroundTransparency = 0.5
frame.BackgroundColor3 = Color3.fromRGB(255, 255, 0) -- Yellow for DeviceSafeInsets
frame.Parent = screenGui
local label = Instance.new("TextLabel")
label.Text = "DeviceSafeInsets"
label.BackgroundTransparency = 0
label.BackgroundColor3 = Color3.fromRGB(255, 255, 255) -- White background
label.TextColor3 = Color3.fromRGB(0, 0, 0) -- Black text
label.Size = UDim2.new(0.3, 0, 0.1, 0)
label.Position = UDim2.new(0.35, 0, 0.45, 0)
label.Parent = frame