Jump to content

Pixijs renderer generateTexture issue


Arin D
 Share

Recommended Posts

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

Link to comment
Share on other sites

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 .

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...