Camera Zoom Example uploaded
jmp909
Member Posts: 73
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
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
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.
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.
Im looking forward to getting home from work so i can test this xoom feature out!