webdeveloper_issy Posted March 22, 2015 Share Posted March 22, 2015 Hi, Maybe there are breaking changes with pixi.js v2.2.7. But I can't find out why displayObjectContainerVar.generateTexture() does work with v1.5.2.v2.2.7 version:http://jsfiddle.net/7gx362e6/2/v1.5.2 version:http://jsfiddle.net/7gx362e6/1/ Kind regards, issy Quote Link to comment Share on other sites More sharing options...
xerver Posted March 23, 2015 Share Posted March 23, 2015 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. Quote Link to comment Share on other sites More sharing options...
webdeveloper_issy Posted March 23, 2015 Author Share Posted March 23, 2015 I was using it so I could create tiles out of an tilesheet and merge those tiles together. But the basics didn't work so I was using the bunny example 1 as demo with the same code 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.