shaderZoom, question about shaders.

  • #1, by ke4Sunday, 23. November 2014, 11:39 6 years ago
    Hi,

    could you please explain me how does this shaders works?
    I tried to do a simple zoom, at beginning of one of my scene, but i don't fully undestand.
    i tried shaderZoom(1.2, 3000, easeQuintOut or easeBounceInOut) according to wiki, but it's not working, its zoomed immediately without any delay, it is not centered to the center of screen, and i would like to use something simple like Linear or swing ease, where can i found what easing i can use? Thanks.

    Key Killer

    810 Posts


  • #2, by afrlmeSunday, 23. November 2014, 12:08 6 years ago
    most of these can be used. Remember though that in VS the names are slightly different, so instead of easeInQuint it is easeQuintIn.

    ease > name > direction.

    shaderZoom just zooms into the current viewport position.

    shaderFollowCharacter will zoom into character position & follow him around the screen until you call stopFollow function, or whatever it is called - I forget.

    You have added the latest version of the shader toolkit as a definition script to your project?

    Imperator

    6815 Posts

  • #3, by ke4Sunday, 23. November 2014, 12:26 6 years ago
    Thanks for the link,
    yes, i added the latest one. Now i used this and it works how i wanted to:

    shaderViewport(1.2, 150, 50, 0, 3000, easeQuadInOut)

    But still don't understand why i had to set up x150 z50 for zoom to center (instead of 0,0 or 150, 150)

    Key Killer

    810 Posts

  • #4, by afrlmeSunday, 23. November 2014, 14:53 6 years ago
    Let's see...

    zoom, x, y, rotation, delay & easing no?

    The default viewport x,y value is 0,0 which is the top left corner of the image. So when you zoom in you need to pan the camera to make it zoom into part of screen you want. It doesn't zoom into the center. There's other issues too like the fact that shader camera can go past the game background image itself. The min value of x & y should be 0 & the max value of y should be scene height - game default resolution y & max x value should be scene width - game default resolution.x to prevent camera from going past boundaries.

    Imperator

    6815 Posts

  • #5, by ke4Sunday, 23. November 2014, 15:48 6 years ago
    Ah, okay :-)

    Key Killer

    810 Posts

  • #6, by afrlmeSunday, 23. November 2014, 16:08 6 years ago
    Actually it does zoom into center of viewport, well that's what Simon just told me. But I'm guessing you were wanting it to zoom into a specific spot which is why you added the offset values.

    Imperator

    6815 Posts

  • #7, by ke4Sunday, 23. November 2014, 16:18 6 years ago
    This is what zoom i wanted.

    Key Killer

    810 Posts

Write post