Studio Device Simulator Service
요약
메서드
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 참조
메서드
Create Device Async
매개 변수
반환
코드 샘플
장치 생성 예제
local Simulator = game:GetService("StudioDeviceSimulatorService")
local id = Simulator:CreateDeviceAsync({
Name = "내 맞춤형 태블릿",
Width = 2560,
Height = 1600,
PixelDensity = 300,
DeviceForm = Enum.DeviceForm.Tablet,
})
print(id)Get Device Info Async
매개 변수
Get Device List Async
Get Orientation Async
Get Scaling Mode Async
Remove Device Async
Set Device Async
Set Orientation Async
매개 변수
반환
()
Set Pixel Density Async
Set Resolution Async
Set Scaling Mode Async
매개 변수
반환
()
Stop Simulation Async
Studio Device Simulator Service: Stop Simulation Async():()
반환
()
Update Device Async
매개 변수
반환
()
코드 샘플
디바이스 업데이트 예제
local Simulator = game:GetService("StudioDeviceSimulatorService")
local id = "CUSTOM_DEVICE_ID" -- CreateDeviceAsync에 의해 반환된 id
Simulator:UpdateDeviceAsync(id, {
Name = "내 맞춤형 태블릿",
Width = 2732,
Height = 2048,
PixelDensity = 264,
DeviceForm = Enum.DeviceForm.Tablet,
})이벤트
Configuration Changed
코드 샘플
구성 변경 예제
local Simulator = game:GetService("StudioDeviceSimulatorService")
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)