HorizontalScrollDistance issue.

  • #1, by ke4Thursday, 27. July 2017, 14:45 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

    Key Killer

    810 Posts


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

    Imperator

    7278 Posts

  • #3, by ke4Thursday, 27. July 2017, 15:23 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.

    Key Killer

    810 Posts

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

    Imperator

    7278 Posts

  • #5, by ke4Thursday, 27. July 2017, 16:11 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.

    Key Killer

    810 Posts

  • #6, by afrlmeThursday, 27. July 2017, 17:22 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.

    Imperator

    7278 Posts

  • #7, by ke4Friday, 28. July 2017, 11:03 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.

    Key Killer

    810 Posts

  • #8, by afrlmeFriday, 28. July 2017, 11:15 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.

    Imperator

    7278 Posts

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

    Key Killer

    810 Posts