megmut Posted March 6, 2017 Share Posted March 6, 2017 Hey guys.. I'm hoping this is something I'm doing wrong, but basically.. when I'm creating a new SVG, it's having width, and height of 1 until 1 frame has passed and then it has actual dimensions. My guess is that the onTextureChange event is being triggered, however the new local transformation isn't happening until the next loop takes place. Here is an example of my code: var texture = PIXI.Texture.fromImage('mySVGPath.svg'); var sprite = new PIXI.Sprite(texture); console.log(sprite.width, sprite.height) // 1, 1 setTimeout(() => { console.log(sprite.width, sprite.height) // 500, 465 }, 0); Is there a way of solving this? Thanks! ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
megmut Posted March 6, 2017 Author Share Posted March 6, 2017 Incase anybody wan't to see a live example, here: https://jsfiddle.net/gmg4uyxx/ Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted March 6, 2017 Share Posted March 6, 2017 That's a real issue, btter to post it in https://github.com/pixijs/pixi.js/issues/ . We'll solve it anyway , but better if you post it there Quote Link to comment Share on other sites More sharing options...
megmut Posted March 7, 2017 Author Share Posted March 7, 2017 Okay, thanks! I've gone and created a new issue https://github.com/pixijs/pixi.js/issues/3813 p.s, I'm blown away by the SVG support, hats off to all the guys that worked on this 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.