Add block comments to videoSensing.videoToggle and setVideoTransparency

This commit is contained in:
Michael "Z" Goddard 2018-04-10 14:26:21 -04:00
parent d4037808a7
commit 461d523729
No known key found for this signature in database
GPG key ID: 762CD40DD5349872

View file

@ -378,6 +378,12 @@ class Scratch3VideoSensingBlocks {
return state.motionAmount > Number(args.REFERENCE); return state.motionAmount > Number(args.REFERENCE);
} }
/**
* A scratch command block handle that configures the video state from
* passed arguments.
* @param {object} args - the block arguments
* @param {VideoState} args.VIDEO_STATE - the video state to set the device to
*/
videoToggle (args) { videoToggle (args) {
const state = args.VIDEO_STATE; const state = args.VIDEO_STATE;
if (state === VideoState.OFF) { if (state === VideoState.OFF) {
@ -389,6 +395,13 @@ class Scratch3VideoSensingBlocks {
} }
} }
/**
* A scratch command block handle that configures the video preview's
* transparency from passed arguments.
* @param {object} args - the block arguments
* @param {number} args.TRANSPARENCY - the transparency to set the video
* preview to
*/
setVideoTransparency (args) { setVideoTransparency (args) {
this.runtime.ioDevices.video.setPreviewGhost(Number(args.TRANSPARENCY)); this.runtime.ioDevices.video.setPreviewGhost(Number(args.TRANSPARENCY));
} }