Jump to content
Search Community

macguffin

Business
  • Posts

    50
  • Joined

  • Last visited

Posts posted by macguffin

  1. I know this is a really really old thread but I was just doing some initial research into "linked nodes".

    Didn't even occur to me to have a look on the gsap forum. 

     

    Lucky I found this thread, which is out of date but gave so much useful information (thanks @OSUblake & @Shrug ¯\_(ツ)_/¯). 

    It's amazing how much content there now is on these forums and the breadth of the topics discussed and solved.

     

    Lesson one - whatever the problem gsap might have a solution - always worth a look on these forums .

     

    :)

     

     

     

    • Like 1
  2. Hi when using pixiPlugin with filters, things like brightness, blur etc you often need to set the resolution of the filer to stop the image becoming blurry.

     

    gsap.to(bunny,{pixi:{brightness:1.3,resolution:2},yoyo:true,repeat:-1,duration:2}

     

    This works - you can see from the object I've logged in the console in the code pen that its resolution has been set correctly.

    It does however complain of Invalid property resolution set to 2 Missing plugin? gsap.registerPlugin()

    If there any way to register a new property in a plugin?

     

    Thanks

    Matt

    Screenshot 2020-04-08 at 13.57.52.png

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

    • Thanks 1
  3. Thanks Zach,

     

    Would that be the same as having a seeded random number?

    I need to be able to have a random function that whilst random can always reproduce the same "randomness" if the seed is the same.

     

    For example if I have this array [a,b,c,d,e,f,g] and need to pick 3 random elements:

     

    If I seeded your random function with "1" I would always pick d,e,f

    If I then seeded it with "4" I would always pick a,f,g and so on

     

    When I build games I have to add randomness, but the game needs to be recreatable. I currently use a cut down version of https://chancejs.com/ but if GSAP was able to do this that would be awesome.

     

    Thanks for your help

    Matt

  4. 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;
    }
  5. 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

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

     

    PIXI.settings.FILTER_RESOLUTION;


    into the PixiPlugin


    PIXI.settings

     

    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
     }

     

    Thanks

  7. 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. 

     

    :-)

  8. 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:

    http://pixijs.download/release/docs/PIXI.filters.ColorMatrixFilter.html

     

    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

     

     

     

    Cheers

    pixihack.png

    • Like 1
    • Thanks 2
  9. 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
  10. 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.

    https://developer.apple.com/library/content/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html

     

    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.

     

    Cheers

    • Like 3
  11. 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.

     

    Also

     

    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

     

    Cheers

     

     

  12. 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.

     

    Cheers

     

  13. 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?

    Thanks

     

     

     

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

     

     

×
×
  • Create New...