mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-06-26 22:30:27 -04:00
Add TargetType enum for use by/with extensions
This commit is contained in:
parent
de9e2be265
commit
defdd42c47
2 changed files with 19 additions and 0 deletions
src/extension-support
|
@ -3,6 +3,7 @@
|
|||
const ArgumentType = require('../extension-support/argument-type');
|
||||
const BlockType = require('../extension-support/block-type');
|
||||
const dispatch = require('../dispatch/worker-dispatch');
|
||||
const TargetType = require('../extension-support/target-type');
|
||||
|
||||
class ExtensionWorker {
|
||||
constructor () {
|
||||
|
@ -47,6 +48,7 @@ class ExtensionWorker {
|
|||
global.Scratch = global.Scratch || {};
|
||||
global.Scratch.ArgumentType = ArgumentType;
|
||||
global.Scratch.BlockType = BlockType;
|
||||
global.Scratch.TargetType = TargetType;
|
||||
|
||||
/**
|
||||
* Expose only specific parts of the worker to extensions.
|
||||
|
|
17
src/extension-support/target-type.js
Normal file
17
src/extension-support/target-type.js
Normal file
|
@ -0,0 +1,17 @@
|
|||
/**
|
||||
* Default types of Target supported by the VM
|
||||
* @enum {string}
|
||||
*/
|
||||
const TargetType = {
|
||||
/**
|
||||
* Rendered target which can move, change costumes, etc.
|
||||
*/
|
||||
SPRITE: 'sprite',
|
||||
|
||||
/**
|
||||
* Rendered target which cannot move but can change backdrops
|
||||
*/
|
||||
STAGE: 'stage'
|
||||
};
|
||||
|
||||
module.exports = TargetType;
|
Loading…
Add table
Add a link
Reference in a new issue