Jibble

The AGS Awards ceremony will take place starting 20:00GMT on Saturday 30 March! Check out the thread for more details and to get the client.

Author Topic: framing the room, that is bigger than the resolution set on game preferences?!?  (Read 142 times)

Hi there again,

If the room is bigger than the resolution I set in the preferences, how can I tell AGS  which part of this bigger romm should it shows? Right now he is showing the center of the room, where I put my character, but he is also cutting my character's head. Is there away to frame it right?

I hope you understand what I mean :(

Thanks :)

If you are not satisfied with default camera controls SetViewport command is used to manually control what part of room is shown. You may want to put this command in function called "late_repeatedly_execute_always", this function is called after character movement but before game is drawn.

For example:
Code: Adventure Game Studio
  1. function late_repeatedly_execute_always()
  2. {
  3.     int extra_y_offset = 100; // an example of adjusting vertical position
  4.     // SetViewport demands coordinates of top-left corner of the "camera" inside the room
  5.     // following command sets viewport centered on player by x and with certain offset by y
  6.     SetViewport(player.x - System.ViewportWidth / 2, player.y - System.ViewportHeight / 2 - extra_y_offset);
  7. }
  8.  

Thanks... I'm gonna try it . I want the camera to show more of the above part of the screen and less of the bottom. Now he is showing somewhere in the middle, and it is cuttig my character's neck and head...  Again thanks :)

If you are not satisfied with default camera controls SetViewport command is used to manually control what part of room is shown. You may want to put this command in function called "late_repeatedly_execute_always", this function is called after character movement but before game is drawn.

For example:
Code: Adventure Game Studio
  1. function late_repeatedly_execute_always()
  2. {
  3.     int extra_y_offset = 100; // an example of adjusting vertical position
  4.     // SetViewport demands coordinates of top-left corner of the "camera" inside the room
  5.     // following command sets viewport centered on player by x and with certain offset by y
  6.     SetViewport(player.x - System.ViewportWidth / 2, player.y - System.ViewportHeight / 2 - extra_y_offset);
  7. }
  8.  

Thank you Crimson Wizard. It worked fine :) I'm so happy, I have you guys support... You are awesome :)

Thanks :)