mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-07-09 20:43:59 -04:00
Merge pull request #1014 from ericrosenbaum/bugfix/video-state
Import and store video state
This commit is contained in:
commit
21ae14c499
2 changed files with 42 additions and 3 deletions
src/serialization
|
@ -341,6 +341,18 @@ const parseScratchObject = function (object, runtime, extensions, topLevel) {
|
|||
if (object.hasOwnProperty('tempoBPM')) {
|
||||
target.tempo = object.tempoBPM;
|
||||
}
|
||||
if (object.hasOwnProperty('videoAlpha')) {
|
||||
// SB2 stores alpha as opacity, where 1.0 is opaque.
|
||||
// We convert to a percentage, and invert it so 100% is full transparency.
|
||||
target.videoTransparency = 100 - (100 * object.videoAlpha);
|
||||
}
|
||||
if (object.hasOwnProperty('info')) {
|
||||
if (object.info.hasOwnProperty('videoOn')) {
|
||||
if (object.info.videoOn) {
|
||||
target.videoState = RenderedTarget.VIDEO_STATE.ON;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
target.isStage = topLevel;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue