Migrating from ML1
The MLBarcodeScanner
and MLArucoTracker
APIs have been unified into a single MLMarkerTracker
API. Additionally, unlike the ML1, the Marker Tracker on the Magic Leap 2 manages its own lifecycle, meaning that the Tracker does not have to be stopped or disposed manually when exiting the app.
MLBarcodeScanner Transition Table
Topic | Magic Leap 1 | Magic Leap 2 |
---|---|---|
Barcode Scanner | MLBarcodeScanner | MLMarkerTracker |
Barcodes Found Event | MLBarcodeScanner .OnMLBarcodeScannerResultsFound | MLMarkerTracker .OnMLMarkerTrackerResultsFound |
Start | MLBarcodeScanner .StartAPI() | MLMarkerTrackerStartScanningAsync() |
Stop | MLBarcodeScanner .StopAPI() | MLMarkerTracker .StopScanningAsync() |
Enable Barcode Scanning | MLBarcodeScanner .Settings.EnableBarcodeScanning | MLMarkerTracker .Settings.EnableMarkerScanning |
Barcode Type | MLBarcodeScanner .BarcodeData.BarcodeType | MLMarkerTracker.MarkerType |
Data | MLBarcodeScanner .BarcodeData.stringData | MLMarkerTracker .MarkerData.BinaryData |
MLArucoTracker Transition Table
Topic | Magic Leap 1 | Magic Leap 2 |
---|---|---|
Barcode Scanner | MLArucoTracker | MLMarkerTracker |
Barcodes Found Event | MLArucoTracker .OnMarkerStatusChange | MLMarkerTracker .OnMLMarkerTrackerResultsFound |
Start | MLBarcodeScanner .StartAPI() | MLMarkerTracker .StartScanningAsync() |
Stop | MLBarcodeScanner .StopAPI() | MLMarkerTracker .StopScanningAsync() |
Marker Data | MLArucoTracker .Marker | MLMarkerTracker .MarkerData |
Tracking Status | MLArucoTracker .Marker.TrackingStatus | Removed |
ID | MLArucoTracker .Marker.id | MLMarkerTracker .MarkerData.ArucoData.Id |
Marker Length | MLArucoTracker .Settings.MarkerLength | MLMarkerTracker .Settings.ArucoMarkerSize |
Dictionary | MLArucoTracker .Settings.Dictionary | MLMarkerTracker .Settings.ArucoDictionary |