Control the camera as you touch and move up the screen?

TouchTiltGamesTouchTiltGames Member Posts: 1,162
edited November -1 in Working with GS (Mac)
I'm trying to figure out how to control the camera using my target (which is where you touch) if the tracking area goes higher than the camera size. This is to see what's at the top of the level before you shoot. There is no other 'control camera' attributes happening at this time.

So if you are touching at the top of the screen beyond the screen area, the camera should continue to scroll up to the top.

My scene is 1024x1024 and the camera size is 1024x768.

On my target instance I've got something like:

When game.target=1 and game.MousePosition.Y > 700
control camera

but the camera doesn't seem to want to follow the target instance, where my finger (the target) is if I keep going up.

Hmm what am I missing here? :P I'm guessing I need to use interpolate in this case...?

Comments

  • scitunesscitunes Member, Sous Chef Posts: 4,047
    I think you need to read this wiki topic. The problem seems to be that your scene is bigger than the camera so you need to deal with the offset. It is explained below:

    http://gamesalad.com/wiki/how_tos:gsc_drag_and_drop_movement#modifications_for_non-default_scene_size
  • TouchTiltGamesTouchTiltGames Member Posts: 1,162
    Ok thanks Scitunes that's great...I remember that tutorial from something else I was doing. I think I'm closer but...

    Problem is do I specify an offset value for the game.MousePosition.Y + game.Offset. if the constrained actor gets too high? OR ie. how do I tell the camera to move the scene up to see the top part of the scene?
  • scitunesscitunes Member, Sous Chef Posts: 4,047
    I think it's just game.mouse + game.camera.origin

    you'll have to unlock an instance in a scene to do it.
  • TouchTiltGamesTouchTiltGames Member Posts: 1,162
    Yeah I had the instance going. Ok thanks ill try that.
Sign In or Register to comment.