new Scratch3Ev3Blocks(runtime)
Creates a new instance of the EV3 extension.
Parameters:
Name | Type | Description |
---|---|---|
runtime |
object | VM runtime |
Members
(static) EXTENSION_ID
The ID of the extension.
runtime :Runtime
The Scratch 3.0 runtime.
Type:
Methods
(private) _forEachMotor(motorID, callback)
Call a callback for each motor indexed by the provided motor ID.
Note: This way of looping through motors is currently unnecessary, but could be useful if an 'all motors' option is added in the future (see WeDo2 extension).
Parameters:
Name | Type | Description |
---|---|---|
motorID |
MotorID | the ID specifier. |
callback |
function | the function to call with the numeric motor index for each motor. |
(private) _formatMenu(menu) → {object}
Formats menus into a format suitable for block menus, and loading previously saved projects: [ { text: label, value: index }, { text: label, value: index }, etc... ]
Parameters:
Name | Type | Description |
---|---|---|
menu |
array | a menu to format. |
Returns:
- a formatted menu as an object.
- Type
- object
getInfo() → {object}
Define the EV3 extension.
Returns:
Extension description.
- Type
- object