Arin D Posted August 28, 2020 Share Posted August 28, 2020 Hi, I am trying to take a snapshot of the main container ( stage) of my application ,which I render on every frame ( customRenderer.render(stage)), and paste that snapshot on the topmost child container of the stage. The code looks like, const snapshot = this._customRenderer.generateTexture(this._stage) const sprite = new Sprite(snapshot ) this._stage.getChildByName("snapshotHolder").addChild(sprite) It takes snapshot alright, but if the stage is scaled down , the sprite even though of actual size of the stage ( lets say 1000x1000), the area covered of it by the snapshot is much less, rest of the area of the sprite is transparent. Not able to understand the logic behind this. I want to take the snapshot of the stage as it is visible (scaled or otherwise). Thanks for your help. -Arin Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted August 28, 2020 Share Posted August 28, 2020 use "renderer.render(stage, myRenderTexture)" directly. RenderTexture should have corresponding size. Quote Link to comment Share on other sites More sharing options...
Arin D Posted August 29, 2020 Author Share Posted August 29, 2020 it still dosent work ? Tried the following, but still the generated sprite has a very small area covered by the stage content snapshot. const rt = PIXI.RenderTexture.create({ width: 1000, height: 1000 }) const ss = this._customRenderer.render(this._stage, rt ) const sprite = new Sprite(ss) this._stage.getChildByName("snapshotHolder").addChild(sprite) Not sure what to do now . Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted August 29, 2020 Share Posted August 29, 2020 it should work. Please make a demo. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.