HorizontalScrollDistance issue.

  • #1, z ke4Thursday, 27. July 2017, 14:45 hodinky 7 years ago
    Hi i have a scene slightly wider than the game resolution (1920) what i'm trying to do is to scroll the scene already when you're for about 200px from the left edge.

    Since the game resolution is 1920x1080 i would set this:
    game.HorizontalScrollDistance = 1720

    But it doesn't seem to be working. It looks like it ignores everything above 700px or so and any bigger distance is ignored.

    Any idea what is the issue here? Thanks

    Zabiják klíčů

    810 Posts


  • #2, z afrlmeThursday, 27. July 2017, 15:18 hodinky 7 years ago
    Correct value is 200. It's pixels from the edge of the screen both sides mate.

    Imperátor

    7285 Posts

  • #3, z ke4Thursday, 27. July 2017, 15:23 hodinky 7 years ago
    It works only when it's already scrolled but to get the first scroll i need to be 200px from the right side.

    Zabiják klíčů

    810 Posts

  • #4, z afrlmeThursday, 27. July 2017, 15:27 hodinky 7 years ago
    Could try using an action area I suppose? Or a loop that listens out for characters position. I dunno mate.

    Imperátor

    7285 Posts

  • #5, z ke4Thursday, 27. July 2017, 16:11 hodinky 7 years ago
    Yeah that's not a bad idea, i just though it's somehow possible to set this.
    I've just set the loop, the scrolling animated through the to() function for some reason isn't that smooth but it looks okay.

    Zabiják klíčů

    810 Posts

  • #6, z afrlmeThursday, 27. July 2017, 17:22 hodinky 7 years ago
    Tried out some of the other easing options for the to() function? I think the default one is easeLinearInOut. If you want it to build up speed then use easeQuintIn or easeQuintInOut if you want it to slow down towards the end too or use easeQuintOut for it to slow down at the end only.

    Imperátor

    7285 Posts

  • #7, z ke4Friday, 28. July 2017, 11:03 hodinky 7 years ago
    Yeah i was trying some of them.
    At the end it's just about mixing the right easing with a correct length of the animation.

    easeSineInOut works probably the best for me.

    Zabiják klíčů

    810 Posts

  • #8, z afrlmeFriday, 28. July 2017, 11:15 hodinky 7 years ago
    Yeah i was trying some of them.
    At the end it's just about mixing the right easing with a correct length of the animation.

    easeSineInOut works probably the best for me.
    I guess that makes sense seeing as it's the big curved ~wavey ~ one. At least you managed to get it sorted out one way or another.

    Imperátor

    7285 Posts

  • #9, z ke4Friday, 28. July 2017, 11:19 hodinky 7 years ago
    Yeah it's more decent than the easeInOutQuint, that one is way to curvy.
    Anyway works great now. Thanks.

    Zabiják klíčů

    810 Posts