엔진 클래스
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)