oukourj Posted November 13, 2016 Share Posted November 13, 2016 Hi, I'm new to Pixi.js and I'm trying to make a simple scene, in RPGMaker Style (with different tiles on the ground to draw the scene). I coded a little app that simply creates all the needed sprites, adds them to a Container (or ParticleContainer, tested both), adds the whole container to the scene, and manages a few keyboard inputs. The result is highly laggy... What am I doing wrong? I would happily look for other ways to do this but I think I'm doing what guides show, so I don't get it. Here is the code : http://pastebin.com/C9UUK8nL Thanks ! Quote Link to comment Share on other sites More sharing options...
xerver Posted November 13, 2016 Share Posted November 13, 2016 Can you put the code into a fiddle so I can debug it? Quote Link to comment Share on other sites More sharing options...
oukourj Posted November 13, 2016 Author Share Posted November 13, 2016 Here you are :https://jsfiddle.net/ztrt8o9a/ But Idk how to upload the images... can I ? I'm thinking that I could change the local links there to links on the internet ? Just let me know. Quote Link to comment Share on other sites More sharing options...
oukourj Posted November 13, 2016 Author Share Posted November 13, 2016 So, as I was re-reading my code I realized that most tutorials don't use an array to store the Sprites, they just add them to the Container. So I changed this at home but no luck, same perf drop... I let the original (array) version on the fiddle. Quote Link to comment Share on other sites More sharing options...
oukourj Posted November 13, 2016 Author Share Posted November 13, 2016 Alriiiiiight, found the error (sorry sometimes you just gotta do something different to finally find :p). I forgot to "cut" in my tileset (texture.frame = rectangle), importing it all repeatedly over my scene... ! Which I couldn't see because it was imported every 32px... giving me the illusion of a successful Sprite cut and import. Thanks for the fast answer anyway ! xerver 1 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.