[FR&EN] Probleme camera with scrolling.

  • #1, by chefgeorgesWednesday, 29. November 2017, 12:45 6 years ago
    [EN]
    Hello everyone,

    This is my first post here. I'm happy to join the VS community (I developed my first P&C on Adventure Game Studio).

    I have a problem with scrolling. I would like it to activate when the character is around the center of the screen. Because the camera refocuses too much, the effect is not very beautiful.

    I show you on video : https://www.youtube.com/watch?v=YZ6gTtavNQ4

    Thank you in advance for your help.

    ------

    [FR]
    Bonjour à tous,

    C'est mon premier post ici. Je suis content de rejoindre la communauté VS (J'ai développer mes premiers P&C sur Adventure Game Studio).

    J'ai un problème avec le scrolling. Je voudrai qu'il s'active lorsque le personnage est environ au centre de l'écran. Car la caméra se recentre trop, l'effet n'est pas très beau.

    Merci d'avance pour votre aide.

    Newbie

    13 Posts


  • #2, by afrlmeWednesday, 29. November 2017, 13:22 6 years ago
    A'llo, you can force the camera to always center on the active character.

    1. navigate to the game properties section of the editor.

    2. click on the lightning icon next to "at begin start following action" to open up a window where you can create some action parts/scripts to be executed on game launch.

    3. create an execute a script action part & add this code to it...
    game.HorizontalScrollDistance = (game.WindowResolution.x / 2)
    game.VerticalScrollDistance = (game.WindowResolution.y / 2)

    This will force the camera to always be centered as we are setting the distance from the edges of viewport to half the size of the game resolution width & height.

    https://i.gyazo.com/daf5b515cca4089b0139191a50da0004.png

    Imperator

    7278 Posts

  • #3, by chefgeorgesWednesday, 29. November 2017, 14:10 6 years ago
    Thank you very much, it will be very useful (also to understand Lua language).

    I tested and it works. ^^

    Newbie

    13 Posts

  • #4, by afrlmeWednesday, 29. November 2017, 15:57 6 years ago
    Nice one! wink

    Imperator

    7278 Posts