Jump to content

Slow drag and weirdness, based on example


dmko
 Share

Recommended Posts

Last time I tried PIXI for a demo was like a year ago, but I dusted off some of the code and I'm hoping to give it a go again :)

I tried to simply use my art assets but with the "Drag" functionality in example 8 at http://www.goodboydigital.com/pixijs/examples/8/

Unfortunately, two weird things happened:

  1. The line "var newPosition = this.data.getLocalPosition(this.parent);" didn't work for me, couldn't find the function- rather I had to add an extra ".data" (var newPosition = this.data.data.getLocalPosition(this.parent);) 
  2. In terms of user experience- holding the object (The music sign in the top-left) and dragging it around, letting go, dragging again, etc. slows things down incredibly... as though it's stacking function calls or something. After a while (10-30 seconds of that) it becomes unusable

I'm hoping I just did some simple thing wrong in the setup... I'd like to keep the modular JS style, I guess that's one difference but I can't imagine how that'd be a showstopper... here's the relevant bits in this test:

Live demo: http://storage.googleapis.com/tjandpals-webdata/seekandfind/dev/index-dev.html

JS Code: http://storage.googleapis.com/tjandpals-webdata/seekandfind/dev/js/seekandfind/Init.js

(note - I'm not maintaining a different build tree just for the forum post, so those links might go away or update as I try solutions, build further, etc.)
 

Link to comment
Share on other sites

OK, strangely - I tried on a different computer today and it seems fine... but the .data.data seems super weird, and there was definitely a performance bottleneck last night!

Are there any tooling options to pinpoint where that bottleneck might be? I.e. even to know what is actually happen with each frame update? If there is some recursive stack building somehow - it would be great to be able to see that ;)

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...