Studio Device Simulator Service
*Deze inhoud is vertaald met behulp van AI (bèta) en kan fouten bevatten. Klik hier om deze pagina in het Engels te bekijken.
Samenvatting
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):() |
Evenementen
API-referentie
Methoden
Create Device Async
Parameters
Teruggaves
Codevoorbeelden
Voorbeeld van een apparaat maken
local Simulator = game:GetService("StudioDeviceSimulatorService")
local id = Simulator:CreateDeviceAsync({
Name = "Mijn Aangepaste Tablet",
Width = 2560,
Height = 1600,
PixelDensity = 300,
DeviceForm = Enum.DeviceForm.Tablet,
})
print(id)Get Device Info Async
Parameters
Teruggaves
Get Device List Async
Get Orientation Async
Teruggaves
Get Scaling Mode Async
Teruggaves
Remove Device Async
Set Device Async
Set Orientation Async
Parameters
Teruggaves
()
Set Pixel Density Async
Set Resolution Async
Set Scaling Mode Async
Parameters
Teruggaves
()
Stop Simulation Async
Studio Device Simulator Service: Stop Simulation Async():()
Teruggaves
()
Update Device Async
Parameters
Teruggaves
()
Codevoorbeelden
Voorbeeld van Update Device
local Simulator = game:GetService("StudioDeviceSimulatorService")
local id = "CUSTOM_DEVICE_ID" -- De id die wordt geretourneerd door CreateDeviceAsync
Simulator:UpdateDeviceAsync(id, {
Name = "Mijn Aangepaste Tablet",
Width = 2732,
Height = 2048,
PixelDensity = 264,
DeviceForm = Enum.DeviceForm.Tablet,
})Evenementen
Configuration Changed
Codevoorbeelden
Voorbeeld van gewijzigde configuratie
local Simulator = game:GetService("StudioDeviceSimulatorService")
Simulator.ConfigurationChanged:Connect(function()
local deviceId = Simulator:GetDeviceAsync()
if deviceId ~= "default" then
local res = Simulator:GetResolutionAsync()
print(string.format("Actief: %s @ %dx%d", deviceId, res.X, res.Y))
end
end)