These are chat archives for pixijs/pixi.js

26th
Dec 2017
suconghou
@suconghou
Dec 26 2017 15:46
hitarea cannot be masked, can anybody help me ?
scarejar
@scarejar
Dec 26 2017 16:24
having a PIXI.Container() filled with sprites but not rendering them with renderer.render() , it's still being "drawn" right ? I would need to set the container.visible = false in order to save computation ?
Ivan Popelyshev
@ivanpopelyshev
Dec 26 2017 17:11
no, its not
pixi doesnt track all containers
render(stage) calls stage updates
hitArea cannot be masked? hm
suconghou
@suconghou
Dec 26 2017 17:12
how can I do this
you see that "else"
i think we need to remove word "else" :)
you can do it yourself https://github.com/pixijs/pixi.js/wiki/v4-Gotchas#css-transforms-on-canvas - see how i override one of interactionManager functions
you can do the same with processInteractive
suconghou
@suconghou
Dec 26 2017 17:14
ok , I will try , thank you
by the way , How can I set the scale center of a container
Ivan Popelyshev
@ivanpopelyshev
Dec 26 2017 17:18
you have to understand the idea of position+scale+pivot
position of container is some position on screen.
pivot is coordinates of that point inside the container
if container has position (screen.width/2, screen.height/2) and pivot (x,y) , that means that object with position (x,y) inside the container appears at the center of the screen
its like you "pin" screen coords and coords inside container
if you want to scale in particular place, i can help with that too ;)
suconghou
@suconghou
Dec 26 2017 17:21
It is very kind of you !
Ivan Popelyshev
@ivanpopelyshev
Dec 26 2017 17:22
yeah, im such a lazy coder
i really need to put all those things in a big book or wiki or somewhere else
suconghou
@suconghou
Dec 26 2017 17:23
It sounds great
Ivan Popelyshev
@ivanpopelyshev
Dec 26 2017 17:24
i just dont want to make it a shiny book for 40$
I'd like my things to be distributed for 1$ in paper
not on quality paper but something that is close to a toiler paper :)
scarejar
@scarejar
Dec 26 2017 18:34
@ivanpopelyshev thanks!
scarejar
@scarejar
Dec 26 2017 21:47

for mapping and culling, I'm having difficulty understanding the conceptual:

let arraydata = [0,0,1,1,0,0,0
                            1,1,0,0,0,1,1] ;
//^convert 1D array to array of PIXI.Sprites
let arrayTextures = [PIXI.SPRITE, PIXI,SPRITE, PIXI.SPRITE, PIXI.SPRITE]  ... //etc];
let mapLayer = new PIXI.Container(...arrayTextures);

so the mapLayer would be the entire map generated and to "cull" them would be to grab the mapLayers.children , loop through them and create another PIXI.Container() that will match the dimensions of the renderer.screen ?