Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: None on Mon 03/08/2009 05:08:31

Title: Question of Method -> Animating Backgrounds.
Post by: None on Mon 03/08/2009 05:08:31
This is not so much as question as to 'how to' as much as 'how should.'

I have an animating background created, but I was *ahem* unaware of the restricted number of frames.
What would be the best way to fix this? Create a large object, and animate that?

Or is there some way to increase the number of possible frames the background can use?

Thx In Advance for any help you can provide. -SAG.

Title: Re: Question of Method -> Animating Backgrounds.
Post by: Gilbert on Mon 03/08/2009 05:24:40
No. There is currently no way to increase the background limit.
You have to either reduce the number of backgrounds, use an object or character, etc., or, if the background is not supposed to be scrolling, tile the frames up into a large background and set the viewport accordingly during the animation (this orks if it's meant to be a standalone animation but if there're objects, characters, etc. in the room this would be hard to manage as you have to relocate these things whenever the viewport has changed).
Title: Re: Question of Method -> Animating Backgrounds.
Post by: GarageGothic on Mon 03/08/2009 12:56:45
You can also use DrawingSurface routines to draw sprites directly to the background. I wrote this code (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=31146.msg399865#msg399865) a while back for someone with the same problem, to draw sprite frames from a View to the background. Should have no frame limit. It uses the old RawDraw function instead of DrawingSurface though, but it's easily changed. Instead of the line (replace both occurences of it):

RawDrawImage(0, 0, backgroundviewframe.Graphic);

Put:

DrawingSurface *surface = Room.GetDrawingSurfaceForBackground();
surface.DrawImage(0, 0, backgroundviewframe.Graphic);
surface.Release;