Does the shuffler have an update() method like the scrambler if it moves? It's not in the docs when I add it it doesn't do anything.
Thanks
Does the shuffler have an update() method like the scrambler if it moves? It's not in the docs when I add it it doesn't do anything.
Thanks
The Shuffler is built on different technology and I don't think it breaks if moved. Does it?
const shuffler = new Shuffler().center()
timeout(1, ()=>{
shuffler.mov(100)
})
still works after the shift
I have it in a draggable card and when I move the card and drag the objects they have an offset as they move. It's weird, I added this simple example and it doesn't break. hmm, let me look at the code.
We will test too.
Here is a Shuffler in a Panel and so far so good... let us know if you did something different.
Just had a thought... if you just put the Shuffler in a Container then put drag on the container, the Shuffler items would potentially then just drag with the outer container's drag and mess things up. You would have to do something like this:
const holder = new Container(600,400).center().cur();
const backing = new Rectangle(holder.width, holder.height, yellow, dark)
.addTo(holder);
const shuffler = new Shuffler().center(holder);
backing.on("mousedown", ()=>{
holder.drag({all:true});
});
backing.on("pressup", ()=>{
holder.noDrag();
});
I have two shufflers on the screen and one seems to lock when one is released and/or sometimes when dragging them both and one is released. There are some multitouch inconsitencies?
Just tested on Apple and Android mobile devices with the spells app that use multiple shufflers and they work fine when dragging a couple at a time.
Oh... just tested the https://zimjs.com/019/shuffler.html and it stops dragging one of the shufflers once the other hand presses up. Interesting... the Spells is our development code... the 019 example is the final code. I wonder if something in the final code has caused it.
Are you using the Shuffler.Collection? We are on the 019 example but not on the spells example.
Should be able to test more tomorrow.
The problem does not show up if running ZIM 018 with the Shuffling code added - which is what Spells is using. We have tracked the bug to the Frame in ZIM 019 where we changed leftEvent activation:
If we put the mouse rather than pointer back in then it works. So the leftEvent is being read by drag() in relation to multitouch functionality. Sigh. Complicated. So digging in to that now.
Ah... I see.
This is in the drag() mousedown and the mouseupplus is being triggered by the other shuffler's mouseup. So giving it some thought.
I have noticed the same 'freezing' issue with just dragging multiple objects, the moment I let go of one the others freeze. Definitely a bug with drag().
No, I didn't use collection.
Thanks for looking into this.
Yes - it looks like this will affect more than the shuffler. Okay - we have removed the deprecated mouseupplus as the pointer events properly handle up events on iframes and consoles, etc. yay. We tested the shuffler and scrambler and it seems good. Thanks. We patched ZIM 019 and advance NPM to 19.1.3. Thanks!