These are chat archives for pixijs/pixi.js

9th
Jul 2015
JorryGo
@JorryGo
Jul 09 2015 06:57
Hi all. How a can making my application on pixijs for many screen sizes? if i make my browser window is small, my UI have random sizes
Ashley Hier
@ash-crash
Jul 09 2015 10:32
How are you handling the sizing of your UI elements ?
Yan Zhabin
@MikeLP
Jul 09 2015 11:02
Hi guys! How I can make scrollable content with clickable areas into canvas (with supporting mouse scroll, keybord arrow keys scroll, mobile touch scroll)?
Ashley Hier
@ash-crash
Jul 09 2015 12:25
Hi Mike,
For mobile touch scroll you need to track touchmove events on your stage and move your scrollable display object container relative to the distance moved
For scrolling you AddEventlistener for nousewheel
Mouse wheel * on canvas, and make sure to prevent the default event propagation for that so that the whole page doesn't scroll. (move the display object container relative to the scroll amount)
Ashley Hier
@ash-crash
Jul 09 2015 12:30
And for key press you are just moving the container a certain amount when a key is pressed
Which is just an EventListener for a keypress
David Bonet
@DavidBM
Jul 09 2015 12:33
For mousewheel you need to normalize the event. You can extract the logic from this plugin. (I don't found any better choice, sorry)
https://github.com/jquery/jquery-mousewheel
My advise is that you make an abstraction that emit the event "drag" or "scroll" for unifying all the events.
In Starriser we use that approach successfully
Yan Zhabin
@MikeLP
Jul 09 2015 14:19
Thanks. I will try it. I think, maybe need to write plugin for pixi.js in future...
David Bonet
@DavidBM
Jul 09 2015 14:22
Yep. My problem was a galaxy map. In a future we will release our utilities for pixijs. For now we have too much work and no time for clean and divide our projects for publishing. Sorry :(
It's hard to make professional WebGL games!