Camera Zoom Example uploaded

jmp909jmp909 Member Posts: 73
edited November -1 in Working with GS (Mac)
zooming the camera by changing it's width/height with an actor instance and adjusting it's origin accordingly. (I've not done anything clever like zoom to an x,y position, just used the centre point)

http://gamesalad.com/game/play/58710

The zoom behaviour is in the watchmen smiley *instance* not the prototype, since this is the only way you can access the camera.

Also note the performance is probably really bad because the constrain function is running all the time (Really it should probably set a timer to stop it running after the interpolation)

This is just proof of concept, maybe someone else with better knowledge could upload an optimized version

Comments

  • KamazarKamazar Member Posts: 287
    Yeah, doing cool stuff always screws with the performance. 'Tis the way of Gamesalad 'til the devs get around to the 100 features we all demand.
  • jmp909jmp909 Member Posts: 73
    well people were saying you couldn't zoom the camera itself. I just wanted to show them that you could ;)

    whether or not it's a good idea or not is a different matter.... altho if you're just switching states rather than interpolating it, and you don't zoom in so far that your sprites become blocky..it should be fine I guess.
  • firemaplegamesfiremaplegames Member Posts: 3,211
    That's awesome, man! Thanks for making this. I will have to think of some cool uses for it!
  • AfterBurnettAfterBurnett Member Posts: 3,474
    But blocky sprites rule! Go retro! Ah... the good old days of Out-Run...
  • jmp909jmp909 Member Posts: 73
    i actually discovered it by accident, but I'm quite new to gamesalad, so i'm hoping someone will be able to look at it, optimize the algorithm so that it only runs when needed, and make it so you can essentially do a zoomTo(x,y,scale)..... and then share it with the rest of us :)

    but potentially you could use it to say zoom on the target on a cannon ball attack, or even a ball when its about to hit your last peg ;)

    actually i'm not sure that latter one would be possible because how would you determine the peg is *about to be* hit?

    Also could someone test this out on a phone? I'm sure a direct zoom cut (rather than tween) would be fine, but i'm not sure an interpolated zoom would work well. It was ok in my Safari browser but then i'm running on a Quad Core.

    j.
  • beefy_clyrobeefy_clyro Member Posts: 5,394
    i think you can use magnitude to detect a distance from something. There are some good bomb explosion demos on here which if i remember correctly use magnitude to determine a distance from the bomb to the actors around it for the blast!

    Im looking forward to getting home from work so i can test this xoom feature out!
  • Rob2Rob2 Member Posts: 2,402
    cheers jmp909 very cool
  • jmp909jmp909 Member Posts: 73
    shame the rotation doesnt work ;)
Sign In or Register to comment.