エンジンクラス
StudioDeviceSimulatorService
*このコンテンツは、ベータ版のAI(人工知能)を使用して翻訳されており、エラーが含まれている可能性があります。このページを英語で表示するには、 こちら をクリックしてください。
概要
方法
CreateDeviceAsync(config: Dictionary):string |
GetDeviceInfoAsync(deviceId: string):Dictionary |
RemoveDeviceAsync(deviceId: string):() |
SetDeviceAsync(deviceId: string):() |
SetOrientationAsync(orientation: Enum.ScreenOrientation):() |
SetPixelDensityAsync(density: number):() |
SetResolutionAsync(width: number,height: number):() |
StopSimulationAsync():() |
UpdateDeviceAsync(deviceId: string,config: Dictionary):() |
APIリファレンス
方法
CreateDeviceAsync
パラメータ
戻り値
コードサンプル
デバイス作成の例
local id = Simulator:CreateDeviceAsync({
Name = "私のカスタムタブレット",
Width = 2560,
Height = 1600,
PixelDensity = 300,
DeviceForm = Enum.DeviceForm.Tablet,
})GetDeviceInfoAsync
パラメータ
戻り値
GetDeviceListAsync
GetOrientationAsync
GetScalingModeAsync
RemoveDeviceAsync
SetDeviceAsync
SetOrientationAsync
パラメータ
戻り値
()
SetPixelDensityAsync
SetResolutionAsync
SetScalingModeAsync
パラメータ
戻り値
()
StopSimulationAsync
StudioDeviceSimulatorService:StopSimulationAsync():()
戻り値
()
UpdateDeviceAsync
パラメータ
戻り値
()
コードサンプル
デバイス更新の例
Simulator:UpdateDeviceAsync(id, {
Name = "私のカスタムタブレット",
Width = 2732,
Height = 2048,
PixelDensity = 264,
DeviceForm = Enum.DeviceForm.Tablet,
})イベント
ConfigurationChanged
コードサンプル
設定変更の例
Simulator.ConfigurationChanged:Connect(function()
local deviceId = Simulator:GetDeviceAsync()
if deviceId ~= "default" then
local res = Simulator:GetResolutionAsync()
print(string.format("アクティブ: %s @ %dx%d", deviceId, res.X, res.Y))
end
end)