These are chat archives for pixijs/pixi.js

10th
Oct 2016
Bailey Stoner
@monokrome
Oct 10 2016 00:01
Like if I wanted every 4th repetition to be a different one
Ivan Popelyshev
@ivanpopelyshev
Oct 10 2016 00:02
in TilingSprite? no
Bailey Stoner
@monokrome
Oct 10 2016 00:02
okay, thanks again :)
Ivan Popelyshev
@ivanpopelyshev
Oct 10 2016 00:02
of course there's a hack...
Bailey Stoner
@monokrome
Oct 10 2016 00:02
I was thinking of just throwing random sprites over it
so that probably will work
Ivan Popelyshev
@ivanpopelyshev
Oct 10 2016 00:03
but not random :(
yeah
random sprites can work
but if you move camera
better to change "sprite.tilePosition" too
that will move insides of tilingSprite
Ralph Sto. Domingo
@ralphstodomingo
Oct 10 2016 08:44
Am I the only one having problems using svgs with pixi.js? :(
Ivan Popelyshev
@ivanpopelyshev
Oct 10 2016 10:27
noo, there's big thread on that
look at open and closed
This message was deleted
Ralph Sto. Domingo
@ralphstodomingo
Oct 10 2016 10:28
done that, filed an issue too. pixijs/pixi.js#3085
Is there something I'm doing wrong? :(
Ivan Popelyshev
@ivanpopelyshev
Oct 10 2016 10:30
And if you assign that string to some img.src, is that working?
Ralph Sto. Domingo
@ralphstodomingo
Oct 10 2016 10:31
Yep, I can load the SVG just fine if I use it as the src of an image. Is that what you meant?
Ivan Popelyshev
@ivanpopelyshev
Oct 10 2016 10:36
yep
and what's in "img.width" and "img.height" after that load?
Ralph Sto. Domingo
@ralphstodomingo
Oct 10 2016 10:37
Lemme look
32x45.
Ivan Popelyshev
@ivanpopelyshev
Oct 10 2016 10:38
i really dont know then
may be "onload" wasnt called
that's the places that you have to debug inside pixi.js
make sure that texture is valid, onload is called and all that stuff
use pixi.min with map file , either plain js http://pixijs.download/dev/pixi.js
also you can always create texture from source
Texture.fromCanvas(img)
Ralph Sto. Domingo
@ralphstodomingo
Oct 10 2016 10:41
But it's called. Hmmm looking at this fiddle, http://jsfiddle.net/confile/w84y9k7c/, putting aside that it uses an SVG that is 404'd, after replacing it with a valid one, turns out, if I don't call a requestAnimFrame on it it won't show.
Ivan Popelyshev
@ivanpopelyshev
Oct 10 2016 10:41
where img is the one with already specified src
Ralph Sto. Domingo
@ralphstodomingo
Oct 10 2016 10:41
Texture.fromCanvas(img) did not work either.
Ivan Popelyshev
@ivanpopelyshev
Oct 10 2016 10:41
if that's about requestAnimFrame, well
image loading is async
just calling one time render() wont do it
Ralph Sto. Domingo
@ralphstodomingo
Oct 10 2016 10:42
Oh. So that means I'm rendering before my svg is loaded?
Ivan Popelyshev
@ivanpopelyshev
Oct 10 2016 10:42
yep
use the loader
Ralph Sto. Domingo
@ralphstodomingo
Oct 10 2016 10:42
But I was using the loader...
Hmm.
render on completion
but for SVG that might not work too, I think that svg has some bonus time for pre-rendering inside browser
Ralph Sto. Domingo
@ralphstodomingo
Oct 10 2016 10:43
yeah I was following that tutorial.
Ivan Popelyshev
@ivanpopelyshev
Oct 10 2016 10:43
that kind of thing we cant detect
Ralph Sto. Domingo
@ralphstodomingo
Oct 10 2016 10:44
At least I was able to show an SVG now. Thanks for the leads. Will update my issue later if I find a way out of this