Jump to content


  • Posts

  • Joined

  • Last visited

Posts posted by macguffin

  1. yeah think you're right I must have been still picking up my adapted pixiPlugin file with this line in it:


    Sorry for all the confusion


    if (v.resolution) {
        filter.resolution = v.resolution;
    } else {
        filter.resolution = PIXI.settings.FILTER_RESOLUTION;
  2. My mistake I was using the old depreciated version

      PIXI.settings.FILTER_RESOLUTION = 2


    I think if you just add this to your code it will set the default resolution of all filters. It looked to be working when I did a quick test

  3. Hi just having a look another approach might be to incorporate 



    into the PixiPlugin



    the plugin currently does this:

     if (v.resolution) {
          filter.resolution = v.resolution;



    @GreenSock if it also did something like this then if the resolution wasn't set manually it could pick up the global resolution for the filter


     if (v.resolution) {
                        filter.resolution =v.resolution;
     } else {
                        filter.resolution = PIXI.settings.FILTER_RESOLUTION



  4. Just wondering if you can change the resolution globally in pixi. 


    Think you you might be able to do something like this

    PIXI.settings.RESOLUTION = 2;


    I’m not at my computer for a bit but will test when I get back as it might be a simpler solution to tackle it at source. 



  5. Hi it might be worth mentioning resolution in your docs with regards to the pixi plugin as the pixi default settings often makes images look blurred:



    If you find that your images are blurry when adding a filter, a colour effect for example, it might help to change the filter's resolution.

    Not sure if you can do this directly with the plug-in but a quick hack like this might help. (Jack can the plugin change resolution?)


    TweenMax.to(PIXI_IMAGE, 0.25, {
                        pixi: {brightness: 0.5},
                        onComplete: (): void => {
                            PIXI_IMAGE.filters[0].resolution = 2;


    The above example if for a single filter on an image.


    As you can see in the screenshot the first bell has its resolution set to 2 whilst the second is using the default of 1






    • Like 1
    • Thanks 2
  6. So you can imagine, it's Saturday night and there's another deadline looming on Monday. I'm just about to settle in to what I reckon is about 2 hours of work animating "a magical trail randomly jumping around the screen". I got some ideas so just need to crack on.

    Before I do I just check the "ease-visualizer" and low and behold I find "rough", which I'd forgotten about. Give it a go and that's kinda what I needed, 20 mins later I have finished the job.

    This keeps happening Jack you have thought of everything and now I don't have any work to do so can enjoy my Saturday evening. So inconsiderate, I mean there's nothing good on TV!!


    Realised I bought TweenMax 8 years ago, people thought I was mad spending that much money on a tween engine (for Flash). I've used TweenMax in every project I've worked on since buying it and can't imaging developing without it.


    So just a quick thanks and I'm off to get a beer.





    • Like 4
    • Haha 5
  7. Hi, it might be because you need a user action to initiate audio on iOS safari. Your user needs to play any audio via a direct request for the audio to play.



    To see if this is the case add an onClick somewhere to play the sound.

    Once you have heard the audio see if it works with the drag event.


    If this is your issue you can play a blank audio with your user click at some point before you need to do the "drag and drop". The user doesn't need to directly request the actual audio you want to play just an audio file.


    this might not be your issue but it's a good thing to rule out.



    • Like 3
  8. Hi just to follow up from the exportRoot stuff


    TL:DR No issues, but with great power comes great responsibility!



    So I think what I was seeing the other day was caused if I paused a few times in a row without un-pausing.

    If you do that some of the boxes jump about and don't start up again.

    Press pause, unpause x5, pause x2, unpause


    (Also did all these with pixi just to test it wasn't pixi related)



    See the Pen GvyeEj?sort_col=item_updated_at%26 by macguffin (@macguffin) on CodePen


    If I add a flag so the pause code doesn't fire unless it's un-paused this never happens.

    Press pause, unpause x5, pause x2, unpause

    All is well.


    See the Pen oepepG by macguffin (@macguffin) on CodePen


    In my next game I'll try exportRoot again and if I get any errors I'll get back to you but as it stands it was probably my bug messing your code.




    If I do it with timescales it is more likely to mess up - expect the is_paused flag need to be onComplete

    Press pause, unpause x5, pause x2, unpause

    See the Pen zdpbMV?sort_col=item_updated_at%26 by macguffin (@macguffin) on CodePen



    If I do it with timescales without the pause flag crashes the browser.

    Press pause, unpause x5, pause x2, unpause


    See the Pen EvoMpB?sort_col=item_updated_at%26 by macguffin (@macguffin) on CodePen





  9. Jack thanks very much for taking the time to explain this stuff and that snippet will be really useful. 


    I will have a play with my stuff and your latest code with regards to the exportRoot. Let me double check I can break it and if I can I'll try and put something together that demos this. If I can break it reliably I'll start a new thread to discuss it.




  10. ok further update (remembered why I didn't use this method)


    The TweenMax.getAllTweens()  does work but TimelineMax animations return to the start rather than just stopping whereas the TweenMax animations stop and start fine.


    Setting the globalTimescale stops everything and resumes it from the last position.


    Is this expected? Anyway around it?





    See the Pen wqPxdp by macguffin (@macguffin) on CodePen



  11. ok back again. 


    The pause stuff it right at the end of the js code, everything else is just setup stuff.


    So I totally agree that exportroot would be the ideal solution.

    However when I make an "export root" timeline create more tweens then do it again and again I run into a maximum call stack exceeded. I never really though this was unreasonable as I'm making more and more timelines.


    So in this pen the bouncing things  represent my game. If I pause using export root (export_pause and export_unpause buttons) and unpause then during the game more tweens are created it will break. After 10 or so pauses the error occurs or the timelines stop being make correctly, or some things stop moving.


    So what I normal do is set the TweenMax.globalTimeScale(0); (pause and unpause buttons). that way I know the error will never occur.


    But what I want to do is have a separate version of TweenMax that can run an animation during the pause (like flashing a close info button) or be able to specify that my tween are on xGlobalTime and the animation during the pause is on yGlobalTime.


    Hope I'm making some sense let me know if you're more confused than before I started. :)



    See the Pen WEXRWP by macguffin (@macguffin) on CodePen




  12. I've always found that export root works a few times but then errors.

    I use spine2d to make/layout my games and convert that into TweenMax timelines. This means that I can have a lot of timlines sitting dormant.


    I can call export root once and it will work but the next time I need to pause I may have new tweens so I call export root again and it will freeze. I guess it's caught in some sort of recursive loop trying to add tweens to a timeline that have already been added.



    Let me see if I can set up a codepen to try and help explain what I'm doing

    • Like 1
  13. "Why in Gods's name would you want 2 instances running you fool" is your first response I'm sure, however.....


    So I have a game and when the instructions come up I pause everything. I've tried all sorts of ways of pausing including export root and running through the global array list. However the most solid way I've found is to 


    as this stops everything nicely, timelines, callbacks, events etc.


    So great now I've paused everything but what if I need to use some tweens on the instruction page, kinda shot myself in the foot there haven't I.


    So back to the original question can I have an independent second instance of TweenMax?

    Could I use 

    window.GreenSockGlobals = {};

    to achieve this?


    As always thanks in advance for any thoughts or suggestions.

  14. Hi just saw your topic.


    When I want to pause all and shut everything down I often do this:


    Setting the globalTimeScale to (0) will stop the animation and any callback/events.

    The problem with


    is that even though the timelines are paused they do seem to complete even though you can't see it happening. When you un-pause your animation will then jump to the end of the timeline.



    • Like 1
  15. Whoo I typed my example so slowly I got 3 replies


    OSUblake that's a really good idea and yes I'm using Pixi Particles.


    I was thinking about storing the reference on the timeline but your solution might mean I can avoid this

    var pe_tl = new TimelineMax({repeat: -1});
    pe_tl.eventCallback("onUpdate", (_x) => {
       console.log('update_time', pe_tl._totalTime-pe_tl.lasttime)
       pe_tl.lasttime=  pe_tl._totalTime;