Camera / Scene shake effect (like earthquake)

  • #10, by afrlmeSunday, 07. September 2014, 23:00 7 years ago
    Ah cheers Simon mate. smile

    So you managed to sort the short code & the scene width stuff? Nice one!

    I'll add that to the shaderPan function when the new version comes out with a boolean option to enable/disable it.

    P.S: will getSize() work for any image sprite or only for scene backgrounds?

    Imperator

    7042 Posts


  • #11, by SimonSSunday, 07. September 2014, 23:05 7 years ago
    I need to rewrite large parts of the script, and it will be getting some new features. Problem with shaderPan, it won't show parts that are not the screen because they aren't drawn. Maybe I change that so they are shown and add parallax in the shader... Need to think about it. getSize works for any sprite that is LOADED, so if the sprite isn't shown and not cached, the call will return {x=-1,y=-1}, also you might not wanna call the function every frame, because it's rather heavy.

    Thread Captain

    1480 Posts

  • #12, by afrlmeMonday, 08. September 2014, 00:02 7 years ago
    ok dokie.

    Should only need to be called once per image/background, as needed. I suppose could always add any that have been called into a table & then check the table to see if it exists...

    In case of scenes you would only need to update a global variable (or local if done with a function) at beginning of each scene.

    Imperator

    7042 Posts