Gamua / Starling-Framework

The Cross Platform Game Engine
http://www.starling-framework.org
Other
2.86k stars 822 forks source link

About RenderTexture #991

Closed king514jy closed 6 years ago

king514jy commented 7 years ago

In the example:

_renderTexture.drawBundled(function():void
            {
                var touches:Vector.<Touch> = event.getTouches(_canvas);

                for each (var touch:Touch in touches)
                {
                    if (touch.phase == TouchPhase.BEGAN)
                        _colors[touch.id] = Math.random() * uint.MAX_VALUE;

                    if (touch.phase == TouchPhase.HOVER || touch.phase == TouchPhase.ENDED)
                        continue;

                    var location:Point = touch.getLocation(_canvas);
                    _brush.x = location.x;
                    _brush.y = location.y;
                    _brush.color = _colors[touch.id];
                    _brush.rotation = Math.random() * Math.PI * 2.0;

                    _renderTexture.draw(_brush);

                    // necessary because 'Starling.skipUnchangedFrames == true'
                    setRequiresRedraw();
                }
            });

In the same scene ,When using feathers videoplayer:

var videoPlayer:VideoPlayer = new VideoPlayer();
videoPlayer.rotation = deg2rad(15);

RenderTexture does not show anything above

var image:Image = new Image(maskTexture);
image.style = new TextureMaskStyle();
videoPlayer.mask = image;

RenderTexture does not show anything above

PrimaryFeather commented 7 years ago

I'm afraid I don't understand what's the exact problem you are reporting. When you've got a VideoPlayer in your scene, RenderTextures stop working? Could you please rephrase your problem? Thx!

king514jy commented 7 years ago

When the videoPlayer sets the rotation, the _renderTexture does not stop working, but does not generate an image

PrimaryFeather commented 7 years ago

Can you also reproduce this problem when you use a video texture directly, without Feathers? That information would help find out if it's a problem in Feathers or Starling.

PrimaryFeather commented 6 years ago

Lacking any more information, I'll close this issue.