> I am looking for a kind of layout manager (easy to use & 
> fairly lightweight). I have done a little digging, and 
> haven't found too much.
> 
> This is for an AS2 project.
> 
> I have a viewing port, and will fill it with Objects of 
> random size. I only want to make sure that I don't end up 
> clumping items too close together, trying to get them to lay 
> themselves out fairly evenly within the target viewport. I 
> will be altering their scale and rotation a bit.
> 
> I could tackle this myself, but I'd rather code more fun 
> things than this.
> 
> Any ideas or links?

This sounds like it might be a job for a Gauss-Seidel kind of method
(basically, 'resolve a bit at a time'). You've got a system with some
variables (the position, scale and rotation of each object) and constraints
(presumably you want the elements to be non-overlapping). What I'd do is
start by spreading the objects evenly (probably in a spiral, it's less
obvious than a grid), then tweak the configuration iteratively a few times
until it meets my requirements. It's the same basic method as is used in
ragdoll bones animations.

Danny

_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to