Jump to content
Search Community

chasebank

Members
  • Posts

    2
  • Joined

  • Last visited

chasebank's Achievements

0

Reputation

  1. Thanks so much for all the info. Glad to take credit for .progress being a clever approach . But the more experience I gain the more I realize that's where I often get into trouble... The trick is learning to recognize when clever becomes too clever. And I thought that progress bit seemed a little too easy... Anyway, I also agree that the viewbox multiplying by 2 thing is strange. In my other tests I was explicitly defining (rather than calculating) dimensions and didn't have any issues there. It was only in these reduced test cases I ran into things only calculating half the dimension. Not obvious to me why that is, (I guess because the zero coordinate is centered?) but doesn't seem too important. One last question to add a bit of complication. Let's say each particle doesn't have a hard coded 20 x 20 dimension, but is instead randomized. Your example has that dimension pre-set in the wrap function, which obviously wouldn't work. Is there any way to access the properties of each object inside the animateParticles function? And then maybe pass the unique dimension into the wrap function? Something like function animateParticles() { animation = TweenMax.to(".box", 2, { x: "+=1000", ease: Linear.easeNone, onComplete: animateParticles, modifiers: { x: wrapPartial((target.width * -1), 1000) } }); }
  2. Hello! I'm trying to dynamically create "particles" and animate them. As far as I can tell, I can get more or less the same result by running through a loop that creates each particle and either adds it to an existing timeline, OR creates a new timeline for each particle. Is there much of a difference there? I'm assuming creating a new timeline for each particle isn't performant, but am very new to this and have no real knowledge to base that claim on. For all I know, this is perfectly reasonable. Follow up question, and where I'm really getting hung up. I'd like each particle to start off at a randomized position, or (it would seem an easier way of phrasing the problem) a randomized "time". .progress() seems perfect for this, but can this only be applied to the entire timeline rather than an individual tween? I can get that working for the timeline, but not each tween. Which is what lead me down the path of creating a new timeline for each particle. Here's an example of the shared timeline, where the .progress() method is getting ignored. And then .progress() working but on a new timeline for each particle And then if there's any other cruel and terrible code crimes I'm committing here... advise is appreciated!
×
×
  • Create New...