File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -818,7 +818,7 @@ public class DisplayObjectContainerIn3D extends Sprite {SCRATCH::allow3d{
818
818
scale = 1 / mosaic;
819
819
}
820
820
}
821
- else if (dispObj is Bitmap ) { // Remove else to allow graphics effects on video layer
821
+ if (dispObj is Bitmap ) {
822
822
isNew = ! bitmapsByID[ id ];
823
823
bitmapsByID[ id ] = (dispObj as Bitmap ). bitmapData ;
824
824
if (unrenderedChildren[ dispObj] && textureIndexByID. hasOwnProperty (id )) {
Original file line number Diff line number Diff line change @@ -466,13 +466,21 @@ public class ScratchStage extends ScratchObj {
466
466
video. attachCamera (camera);
467
467
videoImage = new Bitmap (new BitmapData (video. width , video. height , false ));
468
468
videoImage. alpha = videoAlpha;
469
+ SCRATCH :: allow3d {
470
+ updateSpriteEffects(videoImage, {'ghost' : 100 * (1 - videoAlpha)});
471
+ }
469
472
addChildAt (videoImage, getChildIndex (penLayer) + 1 );
470
473
}
471
474
}
472
475
473
476
public function setVideoTransparency (transparency :Number ):void {
474
477
videoAlpha = 1 - Math . max (0 , Math . min (transparency / 100 , 1 ));
475
- if (videoImage) videoImage. alpha = videoAlpha;
478
+ if (videoImage) {
479
+ videoImage. alpha = videoAlpha;
480
+ SCRATCH :: allow3d {
481
+ updateSpriteEffects(videoImage, {'ghost' : transparency});
482
+ }
483
+ }
476
484
}
477
485
478
486
public function isVideoOn ():Boolean { return videoImage != null }
@@ -546,11 +554,6 @@ public class ScratchStage extends ScratchObj {
546
554
SCRATCH :: allow3d
547
555
public function updateSpriteEffects (spr :DisplayObject , effects :Object ):void {
548
556
if (Scratch. app. isIn3D) {
549
- if (videoImage && videoImage. alpha < 1 ) {
550
- if (! effects ) effects = {};
551
- if (! effects . ghost) effects . ghost = BlockArg. epsilon;
552
- }
553
-
554
557
Scratch. app. render3D. updateFilters(spr, effects );
555
558
}
556
559
}
You can’t perform that action at this time.
0 commit comments