Login / Registrieren
DE EN FR ES IT CZ
Back

shaderZoom, question about shaders.

  • #1, von ke4 Sunday, 23. November 2014, 11:39 12 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.

    ke4


    Key Killer

    810 Posts

  • #2, von afrlme Sunday, 23. November 2014, 12:08 12 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?

    afrlme


    Imperator

    7292 Posts

  • #3, von ke4 Sunday, 23. November 2014, 12:26 12 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)

    ke4


    Key Killer

    810 Posts

  • #4, von afrlme Sunday, 23. November 2014, 14:53 12 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.

    afrlme


    Imperator

    7292 Posts

  • #5, von ke4 Sunday, 23. November 2014, 15:48 12 years ago
    Ah, okay :-)

    ke4


    Key Killer

    810 Posts

  • #6, von afrlme Sunday, 23. November 2014, 16:08 12 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.

    afrlme


    Imperator

    7292 Posts

  • #7, von ke4 Sunday, 23. November 2014, 16:18 12 years ago
    This is what zoom i wanted.

    ke4


    Key Killer

    810 Posts