These are chat archives for pixijs/pixi.js

5th
Jan 2016
Chad Engler
@englercj
Jan 05 2016 02:39
A filter is a special kind of shader, which is why you can assign it to the .shader property. We just use the underlying shader in the filter
Micheal Winger
@mordof
Jan 05 2016 03:09
@ivanpopelyshev from your pixi-tilemap example, it looks like it requires both a texture that contains all of the sprite images, as well as the broken down images for each sprite... is that actually the case?
nevermind.. sometimes thinking of just testing things isn't the first thought to come to mind.
Ivan Popelyshev
@ivanpopelyshev
Jan 05 2016 11:02
that example is for lazy people
who dont want to pass rectangles :))
it needs ONE texture per atlas in constructor to detect baseTexture
so it will have multiple "layers" , corresponding to baseTextures
addFrame(tex, 10, 10) finds layer with the same baseTexture as tex, and uses tex.frame to obtain coordinates
addRect(num, x, y, u, v, width, height) doesnt need texture - you just specify number of layer , screen coordinates and texture frame
Ivan Popelyshev
@ivanpopelyshev
Jan 05 2016 11:15
@englercj we have a problem with ADD: pixijs/pixi.js#2248
please look at it, its affecting rpgmaker MV too
Bar Ziony
@bartzy
Jan 05 2016 15:51
How can I use Pixi with ES6?
i.e, can I load specific stuff instead of using the global PIXI ?
Ivan Popelyshev
@ivanpopelyshev
Jan 05 2016 15:53
Im writing an app in ES6 now, whats the problem? :)
there's also var pixi =require('pixi.js') with browserify
but global PIXI will exist anyway
Bar Ziony
@bartzy
Jan 05 2016 16:05
well, how do I import just "Sprite" ?
Ivan Popelyshev
@ivanpopelyshev
Jan 05 2016 16:08
there's no import in ES6 yet, it even doesnt work in node
you can only import pixi as a whole
ES6 import sucks because it doesnt have packages
Bar Ziony
@bartzy
Jan 05 2016 16:10
I use JSPM...
Ivan Popelyshev
@ivanpopelyshev
Jan 05 2016 16:10
JSPM?
Bar Ziony
@bartzy
Jan 05 2016 16:10
yep. Best thing since sliced bread
:D
Ivan Popelyshev
@ivanpopelyshev
Jan 05 2016 16:10
i mean, how else are we supposed to import just one class from something?
Bar Ziony
@bartzy
Jan 05 2016 16:10
if it exports multiple stuff then you can
Ivan Popelyshev
@ivanpopelyshev
Jan 05 2016 16:11
import { Sprite } from "pixi.js" , something like that?
if that stuff works with browserify, then you can import it for sure :)
Bar Ziony
@bartzy
Jan 05 2016 16:22
Importing like that just puts the entire PIXI object into Sprite
Ivan Popelyshev
@ivanpopelyshev
Jan 05 2016 16:33
that's not what I read in es6 description
import { sum, pi } from "lib/math"
Chad Engler
@englercj
Jan 05 2016 16:44
That only works if we do es6 exports which we don't
we do commonjs exports
Bar Ziony
@bartzy
Jan 05 2016 17:01
Yeah ok it works
What ivan said
works because of the import deconstruction or something like that
Ivan Popelyshev
@ivanpopelyshev
Jan 05 2016 17:01
that's how its supposed to work ;)
@englercj look at ADDitive problem, please
i know that's because pre-multiplied alpha but I dont follow how it actually happens
Bar Ziony
@bartzy
Jan 05 2016 17:02
can I just extend PIXI objects with ES6 extend ?
I use babel as a transpiler
Are there any pitfalls specific to PIXI I should be aware of ?
Chad Engler
@englercj
Jan 05 2016 17:02
I look at every issue that comes in @ivanpopelyshev I will look when I have time
@Bartzy You can use extend, we use normal prototype extension so it will be fine
Ivan Popelyshev
@ivanpopelyshev
Jan 05 2016 17:03
I just remind you that issue is in production already ;)
Chad Engler
@englercj
Jan 05 2016 17:03
All of our issues are in production
Ivan Popelyshev
@ivanpopelyshev
Jan 05 2016 17:04
@Bartzy our old ES5 way is compatible with ES6 stuff
the only thing that differs is syntax
Bar Ziony
@bartzy
Jan 05 2016 17:08
OK
Another question - Do you use Flow perhaps? For type checking
Ivan Popelyshev
@ivanpopelyshev
Jan 05 2016 17:09
type checking is awesome. I use typescript when its possible. And when shit really hits the fan I use scala
you know, that language with "flatMap" thing :)
Chad Engler
@englercj
Jan 05 2016 17:10
We have typescript definitions for pixi, if you wanted to use that: https://github.com/pixijs/pixi-typescript
Bar Ziony
@bartzy
Jan 05 2016 17:11
Can I use that for Flow ?
Bar Ziony
@bartzy
Jan 05 2016 17:18
wow flow is really useless without something like DefinitelyTyped
Bar Ziony
@bartzy
Jan 05 2016 17:31
I'm writing something like an ecards solution, using Pixi.
I have several "layer" types. they can have other layers in them
I have a base layer, image layer, "hole" layer (layer that has an image in it and behaves in a specific way when interacted with), Text Layer
I started by trying to have my own "Layer" class which extends from DisplayObject , or Container for example, and then having an Image class which extends from that Layer (which is my own).
But then I'm getting into issues since images in Pixi are represented with PIXI.Sprite and not PIXI.Container.
Am I doing the wrong thing by trying to have my own Layer class? Should I just extend the right PIXI class instead of having a common "layer" class of my own?
Ivan Popelyshev
@ivanpopelyshev
Jan 05 2016 17:58
just add it as a child (that image)
Bar Ziony
@bartzy
Jan 05 2016 18:20
so you think I should have my own base Layer that extends from PIXI.Container
and my own Image Layer that extends from my Layer , and then that Image layer just adds a child (PIXI.Sprite) ?
Ivan Popelyshev
@ivanpopelyshev
Jan 05 2016 18:21
thats ok
thats ok to have your own container class
Bar Ziony
@bartzy
Jan 05 2016 18:27
What are the benefits here?
Conceptually, Architectural benefits... etc
Ivan Popelyshev
@ivanpopelyshev
Jan 05 2016 18:28
most game engines actually use entity->component architecture
which pixi has not
Bar Ziony
@bartzy
Jan 05 2016 18:28
but pixi is not a game engine :D
Ivan Popelyshev
@ivanpopelyshev
Jan 05 2016 18:29
well you can add fixed width height or osmething like that for your stuff :)
Bar Ziony
@bartzy
Jan 05 2016 18:32
OK. I will make some progress and see if it makes sense
Ivan Popelyshev
@ivanpopelyshev
Jan 05 2016 18:34
aand gameofbombs.com one step forward to moving to pixi.js
It will be epic moment this or next month
Matt Ostgard
@MattOstgard
Jan 05 2016 19:03
@ivanpopelyshev @englercj update on additive blend bug: https://github.com/pixijs/pixi.js/issues/2248#issuecomment-169098404
Ivan Popelyshev
@ivanpopelyshev
Jan 05 2016 20:04
@englercj ideas? change ADD contant depending on renderer/texture behaviour?