OlegShaygu Posted March 2, 2018 Share Posted March 2, 2018 Hi! I'm a newborn at Pixi.JS and ask your help. I'm trying to put 4 characters on the stage in one line. They are moving one by one (in ticker function). Stage width is 928px. The gap between characters is 800px. And I can't understand why first three characters are put at the stage right way, but the last one is above the third one. It seems like the the width is not enough. What should I do? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted March 2, 2018 Share Posted March 2, 2018 Make a fiddle or codepen. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted March 2, 2018 Share Posted March 2, 2018 Look at http://pixijs.download/dev/docs/PIXI.TextStyle.html , if it can help you Quote Link to comment Share on other sites More sharing options...
OlegShaygu Posted March 4, 2018 Author Share Posted March 4, 2018 On 02.03.2018 at 8:29 PM, ivan.popelyshev said: Make a fiddle or codepen. https://jsfiddle.net/OlegShaygu/ra303eu9/10/ Dude, could you be so kind to point on my mistakes? - I uploaded code to jsfiddle to show you and took the error "PIXI.Application is not a constructor", but code works local.. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted March 4, 2018 Share Posted March 4, 2018 Here, you forgot to add pixi js itself in "resources": https://jsfiddle.net/Hackerham/ra303eu9/11/ Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted March 4, 2018 Share Posted March 4, 2018 So, it draws palm, then dog. The result is expected, you've added them in this order. Quote Link to comment Share on other sites More sharing options...
OlegShaygu Posted March 4, 2018 Author Share Posted March 4, 2018 1 hour ago, ivan.popelyshev said: Here, you forgot to add pixi js itself in "resources": https://jsfiddle.net/Hackerham/ra303eu9/11/ Thanks a lot! 1 hour ago, ivan.popelyshev said: So, it draws palm, then dog. The result is expected, you've added them in this order. But I wrote: heroMoving(0, palm, 1.5); heroMoving(800, cactus, 1.5); heroMoving(1600, robot, 1.5); heroMoving(2400, dog, 1.5); and waited all hero are going one by one after 800px, but the dog and the palm are clinging together. How to separate them and put the palm after the dog? May be I should make the screen width longer? or something else? But the Application width must be 928px. 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.