Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: KamikazeHighland on Thu 26/05/2011 05:33:09

Title: Flood Fill? [Solved]
Post by: KamikazeHighland on Thu 26/05/2011 05:33:09
Hi.  In AGS I can draw lines between points, but I'd also like to be able to flood fill the areas between those lines, if possible.  It's odd that I can't find this, since the room editor has this feature...  ::)

Mostly because I can't /skew/ a rectangle in-game... unless I can?
Title: Re: Flood Fill?
Post by: Khris on Thu 26/05/2011 05:49:29
Unfortunately you have to code this yourself. Note that you have to use the DrawingSurface.GetPixel() command a lot, and it's slow.
(Why would the editor's drawing tools have any bearing on what drawing commands are available as script commands anyway? I don't see the connection.)

Same for skewing sprites, you have to code it yourself. I'd use DynamicSprites and copy the first one line by line to the second while constantly increasing the x coordinate.
Title: Re: Flood Fill?
Post by: KamikazeHighland on Thu 26/05/2011 05:54:20
Quote from: Khris on Thu 26/05/2011 05:49:29
(Why would the editor's drawing tools have any bearing on what drawing commands are available as script commands anyway? I don't see the connection.)

Well, I don't know, if you can draw in the editor but you can't make a game using that editor where you can draw in a similar fashion..

Thanks for the quick reply!
Title: Re: Flood Fill? [Solved]
Post by: Gilbert on Thu 26/05/2011 08:00:27
There is module (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=26439.0) that offers this with some limitation (I think).

If that still doesn't suit your need, you have to script it yourself at the moment. I've written some codes when making the AGI picture decoder module (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=40965.0), which you may also check.
Title: Re: Flood Fill? [Solved]
Post by: KamikazeHighland on Thu 26/05/2011 08:53:54
You've both actually been more helpful than you may realize, and I've worked around the issue.

Sometimes you just can't come up with an answer until /after/ you ask.  Thanks!