Jump to content
Search Community

spassvogel

Members
  • Posts

    7
  • Joined

  • Last visited

Posts posted by spassvogel

  1. I have a svg of a isometric world with roads and whatnot. I want to have vehicles driving around set paths. I was thinking of using MotionPathPlugin. Because of the perspective I can't use autorotate and the roads are all at 90 degrees angles from each other. In my svg I have groups for all the vehicles, and within the group I have two subgroups, one for `down` and one for `up`. The `green-truck` is what I want to animate along a path.

     

    image.png.f98b029c1d712d384b75b7f99dbbf339.png

     

    I was thinking to attach some sort of event to the path tween whenever a new path point is hit, in this event check if the next path destination is

    1 . higher (north) than the current one (meaning nextY is less than currentY), in that case show only `-up`. if not, show `-down`

    2. to the left (west) of  the current one (meaning nextX is less than currentX), in that case flip the image horizontally such that the vehicle faces left

     

     

    However, I could find no such events in the documentation.

  2. 42 minutes ago, OSUblake said:

     There is no need to use TweenLite/Max or TimelineLite/Max anymore.
     

     

     

    Okay I must have read that in a forum post somewhere. Probably the documentation is a more sensible place to start. Thanks again.

  3. 25 minutes ago, OSUblake said:

    Make sure you register PixiPlugin, not PIXI.

    
    gsap.registerPlugin(PixiPlugin); 

    Right. That did the trick. Silly of me. Thanks so much

     

     

  4. Another webpack question I'm afraid. I found several topics already but can't make it work.

     

    My stack: typescript webpack babel, in fact I'm using `create-react-app` with typescript template. I installed `npm i gsap --save`

    Importing as such
     

    import * as PIXI from 'pixi.js';
    import { TweenMax } from 'gsap';
    import { PixiPlugin } from 'gsap/all';
    import { gsap } from 'gsap'
    
    
    PixiPlugin.registerPIXI(PIXI);
    gsap.registerPlugin(PIXI); // just to be sure?



    Then in my code

     

            TweenMax.from(ref.current, 1, { pixi: { scaleX: .2, scaleY: 0.2, rotation:60}});

    Unfortunately gives this error

     

    image.png.ac3af0eb7b15e326f209b344a16c8650.png

     

     

    🤔

×
×
  • Create New...