Jump to content

displayObjectContainerVar.generateTexture() not working on v2.2.7?


webdeveloper_issy
 Share

Recommended Posts

    var objContainerBaseTexture = objContainer.generateTexture().baseTexture;    var objContainerTexture = new PIXI.Texture(objContainerBaseTexture);    var objContainerSprite = new PIXI.Sprite(objContainerTexture);
Why are you doing that? The `generateTexture()` method returns a RenderTexture, just use it:

    var objContainerTexture = objContainer.generateTexture();    var objContainerSprite = new PIXI.Sprite(objContainerTexture);
http://jsfiddle.net/7gx362e6/4/

If you press "Run" it works, the reason it seems to not draw anything at first is because you don't want for the image to load to cache the texture so it caches a blank texture.

Either preload the image or wait for it to finish loading before running the texture generation.

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...