These are chat archives for pixijs/pixi.js

27th
Jan 2016
Micheal Winger
@mordof
Jan 27 2016 02:43
so.. there's a problem with the interaction manager, lol
@englercj @ivanpopelyshev mouse events don't check whether they're actually inside of the canvas pixi is rendering to or not. is that a decision that was on purpose?
i'm making toolbars for editing, and resized the canvas as well as the pixi renderer to not include that portion of the screen... mouse events are still being tracked since the events are actually on window, and they have no code preventing outside of canvas hits
Micheal Winger
@mordof
Jan 27 2016 02:56
also really doesn't help that absolutely all of the original event, and global point event x, y's are drastically wrong.... what..
Chad Engler
@englercj
Jan 27 2016 03:07
We don't change the original event, we just pass it through
And events are listened to on the canvas
not window
Micheal Winger
@mordof
Jan 27 2016 03:08
maybe i've got an old version of pixi..
the event listeners are bound on window though
Chad Engler
@englercj
Jan 27 2016 03:09
mouseup is the only thing we listen to on window, so we can catch when you release the mouse if you drag outside the canvas
just mouseup and mousemove
for the reason i just described
Micheal Winger
@mordof
Jan 27 2016 03:09
the only two i'm using, lol
ok
Chad Engler
@englercj
Jan 27 2016 03:09
if we didn't then dragging would be broken as hell
Micheal Winger
@mordof
Jan 27 2016 03:09
yeah - that's solid reasoning
Chad Engler
@englercj
Jan 27 2016 03:10
as for the event being wrong
lolwut
I gots nothing
Micheal Winger
@mordof
Jan 27 2016 03:10
yeah, my coordinates are completely messed. i clicked in the center of my screen (1920 x 1080)
and got x - 4, y 620
for the original event x y (on every single variation of the property)
also...
@englercj should they still be tracking on containers though even when they're outside of the canvas?
Chad Engler
@englercj
Jan 27 2016 03:11
I think it does, not 100% sure
original event comes directly from the browser, we don't change it
mordof @mordof is so very confused
Micheal Winger
@mordof
Jan 27 2016 03:11
that makes sense though.. i just gotta figure out why my stuff just isn't right
Chad Engler
@englercj
Jan 27 2016 03:12
Good luck!
Micheal Winger
@mordof
Jan 27 2016 03:13
thanks
@englercj so... what i'm doing is console.log the event on a mouseup. console doesn't evaluate the object until i expand it. do you know if pixi is updating the original event for mouse moves and updating those x/y's while i move my mouse to check the console output?
yaaay that's it! i'm not crazy
Chad Engler
@englercj
Jan 27 2016 03:17
oh yeah definitely
Micheal Winger
@mordof
Jan 27 2016 03:17
so mouse moves alter the event object that gets sent to a mouseup event
Chad Engler
@englercj
Jan 27 2016 03:17
just the values directly
references are lazy eval'd
There is only 1 event object
mordof @mordof nods
Chad Engler
@englercj
Jan 27 2016 03:17
in the interaction manager
since calls are synchronous we just skip the allocation and reuse the object
Micheal Winger
@mordof
Jan 27 2016 03:18
mhmm
that makes sense
Chad Engler
@englercj
Jan 27 2016 03:18
but that a silly side effect of it haha!
Micheal Winger
@mordof
Jan 27 2016 03:18
kinda the situation Bartzy was referring to, but whatever
didn't take that long to resolve, and it'll very very rarely be an issue
ok... phew... yay for feeling like i'm going crazy
@englercj thanks for the help :)
Chad Engler
@englercj
Jan 27 2016 03:20
np!
Micheal Winger
@mordof
Jan 27 2016 03:20
also - loving pixijs ^_^ my map engine is coming along fantastically with good performance
very happy with it
Chad Engler
@englercj
Jan 27 2016 03:20
that's great! glad it has been helpful
Micheal Winger
@mordof
Jan 27 2016 04:53
woo! toolbars with rudamentary map controls implemented... which introduces another necessary feature. map chunk loading.. blegh
Ivan Popelyshev
@ivanpopelyshev
Jan 27 2016 10:39
nice
are you using my tilemap?
Ivan Popelyshev
@ivanpopelyshev
Jan 27 2016 11:09

mouse events don't check whether they're actually inside of the canvas pixi is rendering to or not. is that a decision that was on purpose?

No it wasnt the purpose. Interaction just sucks, you are free to make PR for it.

Micheal Winger
@mordof
Jan 27 2016 13:27
ah
@ivanpopelyshev no i'm not. i made my own based off that one example i found, and then modified it with your suggestions of making it a square
@ivanpopelyshev http://cl.ly/431q260b3h1C quick example of both raised, and lowered, land. very rudimentary controls for choosing the tool in my toolbar.. lol
oh hey it pulled the screenshot into the chat...
Ivan Popelyshev
@ivanpopelyshev
Jan 27 2016 16:07
nice!! :)
yeah, my tilemap wont do that yet