zoom camera to specific x,y coordintate

crapscraps Member Posts: 353
edited November -1 in Working with GS (Mac)
I understand that the camera can not be controlled unless you are in the "scene" to access its attributes.

I can make the camera "zoom" to a specific x,y coordinate by using interpolate size of image and the position of the camera.

But that is a one shot thing - touch the scene and it zooms to those 2 points.

What to do if I would like multiple different areas to be zoomed in on?

Comments

  • crapscraps Member Posts: 353
    I tried to make a video game like controller to show the actions of zoom / backup / left and right.

    Here's what developed.
  • PhoticsPhotics Member Posts: 4,172
    craps said:
    What to do if I would like multiple different areas to be zoomed in on?

    Change the size of the camera size based on the distance between the two actor location... plus some offset, based on actor size.

    If you want multiple zoom points, then create invisible hotspots with data for the camera attribute changes.
  • crapscraps Member Posts: 353
    Photics said:
    Change the size of the camera size based on the distance between the two actor location... plus some offset, based on actor size.

    Could you elaborate on what you mean by changing the camera size ( do you mean to decrease it as it zooms in?), and I dont understand the offset based on the actor size.

    If your talking about the movement of the camera (not a straight zoom in) I wanted that to appear as if the actor was looking around and then focusing on one area.

    Thanks
  • PhoticsPhotics Member Posts: 4,172
    You want to pan and then zoom?

    To zoom the camera, you make the X and Y size smaller.
    To pan the camera, you change the camera's origin location.
  • crapscraps Member Posts: 353
    Thanks. That helps. To give the feel of looking around I am playing with changing the interpolation times for each camera and origin coordinate.
  • crapscraps Member Posts: 353
    Where ever the screen is touched my actor will move to that location using the following.

    constrain att - self.positionX = game.mouse.positionX
    constrain att = self.positionY = game.mouse.positionY

    This all works fine.

    I would like to control the camera along with moving the actor to the game.mouse.position X&Y.

    This would have to be in the scene to access the camera attribute.

    game.scene.camera ??? Is it possible to make the camera go to game.mouse.position X&Y?
Sign In or Register to comment.