Likl Posted September 10, 2019 Share Posted September 10, 2019 I am a new for PIXI. When I want to draw surrounding line on a rectangle , i use getBounds() method. But there is something difference between 2 calls, the first time I got a coordinate which is relative to the app stage, second time I got a coordinate which is relative to the browser window. However, between two calls, the invoked PIXI.Graphics has the same parent and children .I just don't know why is it. ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted September 10, 2019 Share Posted September 10, 2019 Interesting. It should work. Please post a demo on codepen, jsfiddle or pixi-playground. we are currently fixing bounds, so maybe dev build can help you: pixijs.download/dev/pixi.js Welcome to the forums! Quote Link to comment Share on other sites More sharing options...
Likl Posted September 12, 2019 Author Share Posted September 12, 2019 I just don't know how to abstract my problem into a demo vividly, maybe like this: https://pixiplayground.com/#/edit/A1rmMvGweWbWYig1xE7ua And I have a typing error above : PIXI.Graphics.getBounds() should be PIXI.Sprite.getBounds() instead. I noticed that in my own program, PIXI version point to 4.5.5, while the pixi-playground hold the minimum version for v4.6.1, And in v4.6.1 , my problem didn't reproduce. It's time to upgrade my pixi version thanks for your reply a lot. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted September 12, 2019 Share Posted September 12, 2019 I've modified demo a bit to make bounds visible. Your problem with demo is that bunny dont have width/height , they are not loaded yet fromImage('some.png') cant get information about image right now the same way <img src=...> doesnt show you image the same , unless that image is pre-loaded. If you consolelog bunny's dimensions - you'll see zeros. You have to use loader for that demo. Also, I cant guarantee anything about previous versions, we've fixed so many bugs.. 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.