Motor Sınıfı
StudioDeviceSimulatorService
*Bu içerik, yapay zekâ (beta) kullanılarak çevrildi ve hatalar içerebilir. Sayfayı İngilizce görüntülemek için buraya tıkla.
Özet
Yöntemler
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):() |
Olaylar
API Referansı
Yöntemler
CreateDeviceAsync
Parametreler
Dönüşler
Kod Örnekleri
Cihaz Oluşturma örneği
local id = Simulator:CreateDeviceAsync({
Name = "Özel Tabletim",
Width = 2560,
Height = 1600,
PixelDensity = 300,
DeviceForm = Enum.DeviceForm.Tablet,
})GetDeviceInfoAsync
Parametreler
Dönüşler
GetDeviceListAsync
GetOrientationAsync
Dönüşler
GetScalingModeAsync
Dönüşler
RemoveDeviceAsync
SetDeviceAsync
SetOrientationAsync
Parametreler
Dönüşler
()
SetPixelDensityAsync
SetResolutionAsync
SetScalingModeAsync
Parametreler
Dönüşler
()
StopSimulationAsync
StudioDeviceSimulatorService:StopSimulationAsync():()
Dönüşler
()
UpdateDeviceAsync
Parametreler
Dönüşler
()
Kod Örnekleri
Cihaz Güncelleme örneği
Simulator:UpdateDeviceAsync(id, {
Name = "Özel Tabletim",
Width = 2732,
Height = 2048,
PixelDensity = 264,
DeviceForm = Enum.DeviceForm.Tablet,
})Olaylar
ConfigurationChanged
Kod Örnekleri
Yapılandırma değişikliği örneği
Simulator.ConfigurationChanged:Connect(function()
local deviceId = Simulator:GetDeviceAsync()
if deviceId ~= "default" then
local res = Simulator:GetResolutionAsync()
print(string.format("Aktif: %s @ %dx%d", deviceId, res.X, res.Y))
end
end)