These are chat archives for pixijs/pixi.js

24th
Jan 2018
@R_Talon_twitter
Jan 24 2018 10:19
Hello machines!!! I have a problem.
Usually, I have a Sprite with OVERLAY ( using pixi-picture ) and run perfectly. Now, I create a new PIXI.Sprite( PIXI.Texture.WHITE ) as a mask of my firts Sprite overlayed. The result is wrong because I see a black image. Any solution?
Ivan Popelyshev
@ivanpopelyshev
Jan 24 2018 10:58
use Graphics as a mask
@R_Talon_twitter
Jan 24 2018 10:58
instead of Sprite?
Ivan Popelyshev
@ivanpopelyshev
Jan 24 2018 10:58
graphics masks are different because they use stencil or scissor
sprite masks are using extra framebuffer, that's like different layer
and that layer doesnt contain background that you want to blend your sprite with
@R_Talon_twitter
Jan 24 2018 11:01
ok ok
I am going to prove it
Do you know that you are a machine, Ivan?
run perfectly with graphics!!!! oh yeah!!
Ivan Popelyshev
@ivanpopelyshev
Jan 24 2018 11:06
^_^
Ivan Vodopiviz
@ivodopiviz
Jan 24 2018 14:57
so, let's say that I want to make a card game and I need to flip said card. would it be possible to rotate it in 3d?
I know I can do it by scaling horizontally, but I don't like how it looks
I also know that I could just mess with the sprite's transform... but docs say that the transform property is going to be read-only
is there a "kosher" way of implementing this?
Ivan Popelyshev
@ivanpopelyshev
Jan 24 2018 14:59
no its not.
you have to wait while i upgrade pixi-projection for 3d
or use my old v4 fork:
Ivan Vodopiviz
@ivodopiviz
Jan 24 2018 15:01
thanks for the info
Ivan Popelyshev
@ivanpopelyshev
Jan 24 2018 15:01
or you can add 3d in https://github.com/pixijs/pixi-projection :) a number of people waiting it
people want it, but im too busy
just look at how 2d implemented there, and do the same for 3d :)
Ivan Vodopiviz
@ivodopiviz
Jan 24 2018 15:02
that might be a better possibility, since using a fork isn't
for stupid reasons we use a global pixi for many games
I'll investigate pixi-projections :)
Ivan Popelyshev
@ivanpopelyshev
Jan 24 2018 15:04
2d projection is enough for quad transform, but not for rotation :(
also GoodBoyDigital has their own private 3d plugin
its possible it will be released after v5.
Ivan Vodopiviz
@ivodopiviz
Jan 24 2018 15:34
I see, I think I'll go with scale for the moment and investigate your lib to see if I can help
thanks a lot
Jon
@jiyinyiyong
Jan 24 2018 16:21
need help with transform.pivot , it looks weird.
any examples or interactive demos please?
totally different from transform origin, which is used by CSS

(defn create-logo! [store]
  (.appendChild (.querySelector js/document ".container") pixi-app.view)
  (dotimes [n 2]
    (let [graphics (PIXI.Graphics.)]
      (-> graphics .-transform .-pivot (.set 0 0))
      (-> graphics
          (.beginFill 0xff3300)
          (.lineStyle 2 0x000000 1)
          (.drawEllipse 200 200 20 80)
          (.endFill))
      (set! (.-rotation graphics) (* n 0.4))
      (.addChild pixi-app.stage graphics))))
my code in ClojureScript, if you can read