Engine-Klasse
StudioDeviceSimulatorService
*Dieser Inhalt wurde mit KI (Beta) übersetzt und kann Fehler enthalten. Um diese Seite auf Englisch zu sehen, klicke hier.
Zusammenfassung
Methoden
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):() |
Events
API-Referenz
Methoden
CreateDeviceAsync
Parameter
Rückgaben
Code-Beispiele
Gerät erstellen Beispiel
local id = Simulator:CreateDeviceAsync({
Name = "Mein benutzerdefiniertes Tablet",
Width = 2560,
Height = 1600,
PixelDensity = 300,
DeviceForm = Enum.DeviceForm.Tablet,
})GetDeviceInfoAsync
Parameter
Rückgaben
GetDeviceListAsync
GetOrientationAsync
Rückgaben
GetScalingModeAsync
Rückgaben
RemoveDeviceAsync
SetDeviceAsync
SetOrientationAsync
Parameter
Rückgaben
()
SetPixelDensityAsync
SetResolutionAsync
SetScalingModeAsync
Parameter
Rückgaben
()
StopSimulationAsync
StudioDeviceSimulatorService:StopSimulationAsync():()
Rückgaben
()
UpdateDeviceAsync
Parameter
Rückgaben
()
Code-Beispiele
Beispiel für die Aktualisierung des Geräts
Simulator:UpdateDeviceAsync(id, {
Name = "Mein benutzerdefiniertes Tablet",
Width = 2732,
Height = 2048,
PixelDensity = 264,
DeviceForm = Enum.DeviceForm.Tablet,
})Events
ConfigurationChanged
Code-Beispiele
Beispiel für geänderte Konfiguration
Simulator.ConfigurationChanged:Connect(function()
local deviceId = Simulator:GetDeviceAsync()
if deviceId ~= "default" then
local res = Simulator:GetResolutionAsync()
print(string.format("Aktiv: %s @ %dx%d", deviceId, res.X, res.Y))
end
end)