エンジンクラス
UserGameSettings
*このコンテンツは、ベータ版のAI(人工知能)を使用して翻訳されており、エラーが含まれている可能性があります。このページを英語で表示するには、 こちら をクリックしてください。
概要
プロパティ
方法
GetOnboardingCompleted(onboardingId: string):boolean |
SetOnboardingCompleted(onboardingId: string):() |
イベント
FullscreenChanged(isFullscreen: boolean):RBXScriptSignal |
StudioModeChanged(isStudioMode: boolean):RBXScriptSignal |
コードサンプル
ユーザーゲーム設定リスナー
local gameSettings = UserSettings().GameSettings
local function onGameSettingChanged(nameOfSetting)
-- この設定の値を取得するためにpcallを使用して確実に取得できるようにします。
-- 時々、LocalScriptsがアクセスできないプロパティでイベントがトリガーされることがあります。
local canGetSetting, setting = pcall(function()
return gameSettings[nameOfSetting]
end)
if canGetSetting then
print("あなたの " .. nameOfSetting .. " が次のように変更されました: " .. tostring(setting))
end
end
gameSettings.Changed:Connect(onGameSettingChanged)APIリファレンス
プロパティ
ComputerCameraMovementMode
ControlMode
方法
GetOnboardingCompleted
SetCameraYInvertVisible
UserGameSettings:SetCameraYInvertVisible():()
戻り値
()
SetGamepadCameraSensitivityVisible
UserGameSettings:SetGamepadCameraSensitivityVisible():()
戻り値
()
イベント
FullscreenChanged
パラメータ
コードサンプル
フルスクリーンモード検出
local gameSettings = UserSettings().GameSettings
local function checkFullScreenMode()
local inFullscreen = gameSettings:InFullScreen()
if inFullscreen then
print("フルスクリーンモードが有効です!")
else
print("フルスクリーンモードが無効です!")
end
end
checkFullScreenMode()
gameSettings.FullscreenChanged:Connect(checkFullScreenMode)StudioModeChanged
パラメータ